Importing Dates from Strings in "DD-MMM-YYYY HH.NN.SS.ssss" Format
Posted on 2007-12-03
I have a data file that I receive daily from another source. I cannot change the format of the datafile. I need to import the contents of the file into my SQL database (MS SQL Server 2000), and then perform various analyses. Two of the fields are datetime fields in the format: "DD-MMM-YYYY HH.NN.SS.ssss". I need the fields to be true datetime fields in my database.
A simple CAST or CONVERT gives me an error, saying that the string could not be converted to a date, presumably because of the month being in MMM format?
Is there a way to manipulate these date strings so that they can be properly imported?