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

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
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,221,704
Messages
6,161,390
Members
451,701
Latest member
ckrings

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