Artie (ar*******@yahoo.com) writes:
I have a date field stored as an INT and need to convert to a date format
mm/dd/yyyy. I'm having trouble determining what the starting date is.
min(date) = 730395
max(date) = 733189
Starting at 01/01/1900, 730395 would make the min year 3901?
As Celko said, you need to know your data, and we cannot really help you
on that point. You need to consult the documentation for this database,
or find someone who knows about it.
That said, I ran this on SQL 2008:
select dateadd(day, 730395, convert(date, '0001-01-01'))
select dateadd(day, 733189, convert(date, '0001-01-01'))
And I got back:
2000-10-03
2008-05-28
Which certainly looks compelling. But again, you need to verify.
--
Erland Sommarskog, SQL Server MVP,
es****@sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx