question

ryanDrayton avatar image
ryanDrayton asked

Importing Dates from .CSV file

I am trying to import dates from a .csv file using the import wizard. the date is formatted as mm.dd.yy in the file. I have set the import to see that column as database date and created the table to accept date in said column. However the data come into the table as 1899-12-30. please help
datecsvdate-format
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
AndrwWhlr avatar image
AndrwWhlr answered
Seems like you could likely just import it as a string and parse it out to a new created date column after the import and then drop the string column. Not sure what version you are using but on the import wizard the data source once you've selected it will give you something like this picture. The datatypes for a given column are on the advanced tab and you and you change them to whatever you like.![alt text][1] ![alt text][2] [1]: /storage/temp/3363-importwizard1.png [2]: /storage/temp/3364-importwizard2.png

importwizard1.png (66.0 KiB)
importwizard2.png (73.8 KiB)
1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

ryanDrayton avatar image ryanDrayton commented ·
Thank you for your response... I have been playing with those advance setting now for days. I just cant understand why it does not see my data as a valid date and replaces it with a default date. I have even changed the regional setting to match my data format as the source of the data will always output dates that way. I am using SQl2012 i will import it as a string and try the conversion in a query to see if it works then create a new table to store my data thanks again
0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.