December 5, 2009 at 12:24 am
I want o import excel sheet which have a datetime columns such as Date of Birth into sql server datetime,but problem is that in the excel sheet datetime format is "dd-mm-yyyy" and the sql server appends "MM/dd/yyyy".how can i import this column.
December 5, 2009 at 12:39 am
When you import data from Excel using wizard, the column with Date will appear in this format
yyyy-mm-dd hh:nn:ss.mss
so you can now select the imported table with formatting date convert(nvarchar, date_column, 105)
The script will look like this:
SELECT your_columns, CONVERT(NVARCHAR, date_column, 105) AS your_format
FROM imported_table
Viewing 2 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy