DateTime fields from SQL Server display incorrectly in Excel

I also had an issue with this problem simply copy and pasting DATETIME fields from SQL Management Studio to Excel for manipulation. Excel has the correct value of the DATETIME (even if the formatting is applied after the paste), but by default doesn’t have a built in format to show the SQL DATETIME. Here’s the fix:

Right click the cell, and choose Format Cells. Choose Custom.
In the Type: input field enter

yyyy-mm-dd hh:mm:ss.000

Reference: http://office.microsoft.com/en-us/excel-help/create-a-custom-number-format-HP010342372.aspx

Leave a Comment