Collections:
Casting Numeric Values to DATETIME in SQL Server Transact-SQL
Can I cast numeric values to DATETIME values in SQL Server Transact-SQL?
✍: FYIcenter.com
Yes, you can cast numeric values to DATATIME values in Transact-SQL. The implicit casting rules are for numeric values to DATETIME values are:
Here are some examples of casting numeric values to DATETIME values implicitly:
DECLARE @x DATETIME; SET @x = 0; SELECT @x; ----------------------- 1900-01-01 00:00:00.000 DECLARE @x DATETIME; SET @x = 1; SELECT @x; ----------------------- 1900-01-02 00:00:00.000 DECLARE @x DATETIME; SET @x = 0.1; SELECT @x ----------------------- 1900-01-01 02:24:00.000 DECLARE @x DATETIME; SET @x = -1; SELECT @x; ----------------------- 1899-12-31 00:00:00.000
⇒ Entering 0.001 Second in DATETIME in SQL Server Transact-SQL
⇐ Entering Date and Time Values in SQL Server
2017-04-15, 3189🔥, 0💬
Popular Posts:
How To Query Tables and Loop through the Returning Rows in MySQL? The best way to query tables and l...
How to continue to the next iteration of a WHILE loop in SQL Server Transact-SQL? How to use CONTINU...
How to check if two JSON values have overlaps using the JSON_OVERLAPS() function? JSON_OVERLAPS(json...
Where to find tutorials to answer some frequently asked questions on Microsoft SQL Server Transact-S...
How to calculate the storage size of a JSON (JavaScript Object Notation) value using the JSON_STORAG...