SELECT CAST('2016' as DATETIME)
SELECT CAST(2016 AS DATETIME)
The first, converting a string to datetime, is assumed to be the first of January of the year specified. The second, converting an integer to datetime, is assumed to be the number of days since 1900-01-01
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
We walk in the dark places no others will enter
We stand on the bridge and no one may pass