I am trying to import a table from Excel into SQL Server and there is one field that sometimes contains a date (mm/dd/yyyy
) and sometimes contains a date and text (mm/dd/yyyy notes
).
When I use the import wizard the rows that just have a date are converted to a five digit number (#####
). The rows that have the date and text appear normally. There is another field that is only a date and that imports normally as datetime.
I also tried to write a import statement in excel like this:
="Import into MyTable values('"&A2&"','"&B2&"', [...] )"
But that also formatted the date as a five digit number.
Does anyone have a suggestion to import this field and preserve the date format? If that is not possible then can I convert from the five digit number back to a date?