how to convert datetime excel sheet to sqlserver datetime

  • 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.

  • 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

    ============================================================
    SELECT YOUR PROBLEM FROM SSC.com WHERE PROBLEM DESCRIPTION =
    http://www.sqlservercentral.com/articles/Best+Practices/61537/[/url]

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply