convert sql date in excel...

dlorenc

Board Regular
Joined
Aug 17, 2004
Messages
140
Im confused..how do I convert a number that was imported from ms sql 2005...into its date format in excel?..

this sql statement: select actual_end_date,dateadd(s,Actual_End_Date,'19700101')

gives me:
actual_end_date (No column name)
1203693715 2008-02-22 15:21:55.000.

now I have: 1203693715, in an excel cell..and I know it should convert to 2/22/08...???...
 
Last edited:

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
boy was I confused...my formula was pointing to the wrong cell..*sigh*..here is my solution..

F8 = 1,203,693,715.0 # seconds from 1/1/1970

as excel dates work in days, the conversion is =+E13+(F8/(60*60*24))

where e13 is 1/1/1970 (or use the raw number (set to general instead of date): 25569
and F8 is my number of seconds...

result is 2/22/08 3:21 PM
 
Upvote 0

Forum statistics

Threads
1,223,626
Messages
6,173,414
Members
452,514
Latest member
cjkelly15

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top