Converting int to datetime nean to add days as the int number to 1900-01-01 00:00:00.
What nean:
cast(37947 as datetime) = dateadd(day, 37947, '19000101 00:00:00')
[=20031124 00:00:00]
and:
select cast(0 as datetime) = 1900-01-01 00:00:00
Converting datetime to ing will return the number of the days since 1900-01-01 00:00:00:
select cast(cast('20031124 00:00:00' as datetime) as int) = 37947
BTW:
select cast(37947.5 as datetime) will return 2003-11-24 12:00:00.000
No comments:
Post a Comment