I got a column called DateOfBirth in my csv file with Excel Date Serial Number Date
Example: 36464
37104
35412
When i formatted cells in excel these are converted as 36464 => 1/11/1999
37104 => 1/08/2001
35412 => 13/12/1996
In SQL:
SELECT DATEADD(d,36464,'1899-12-30')
-- or thanks to rcdmk
SELECT CAST (36464 - 2 as SmallDateTime)
SELECT CONVERT(DATE, DATEADD(day, CONVERT(INT, 36464), '1899-12-30'))
In SSIS, see here: http://msdn.microsoft.com/en-us/library/ms141719.aspx
Source : https://stackoverflow.com/questions/13850605/convert-excel-date-serial-number-to-regular-date
Komentar
Posting Komentar