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
I need to do this transformation in SSIS or in SQL. How can this be achieved?
Google BigQuery solution
Standard SQL
In SQL:
In SSIS, see here
http://msdn.microsoft.com/en-us/library/ms141719.aspx
Try the approach discussed in the following link, which involves creating a function that performs the converstion and applying the function in your SQL.
http://www.ehow.com/how_12073756_convert-julian-date-sql.html
This worked for me because sometimes the field was a numeric to get the time portion.
Command:
In addition of @Nick.McDermaid answer I would like to post this solution, which convert not only the day but also the hours, minutes and seconds:
For example
42948.123
to2017-08-01 02:57:07.000
42818.7166666667
to2017-03-24 17:12:00.000
The marked answer is not working fine, please change the date to "1899-12-30" instead of "1899-12-31".