October 30, 2006 at 4:45 pm
hi guys
I am trying to import a flat file(txt) into sql. This flat file has got a datetime field with time in 'a.m.'
Now SQL is not recognising this field and I get a type conversion error.
Is there a way to replace 'a.m.' with 'am' while importing the flat file using a wizard???
Thanks
Mita
October 30, 2006 at 6:28 pm
Which wizard?
_____________
Code for TallyGenerator
October 30, 2006 at 6:47 pm
The Import/Export wizard of SQL server 2005
October 30, 2006 at 7:05 pm
might be better answered in a 2005 forum
(although cross posting is not encouraged)
Thank-you,
David Russell
Any Cloud, Any Database, Oracle since 1982
November 1, 2006 at 10:15 pm
I would suggest importing as a VarChar(##), then you can add a date column and do something like this:
UPDATE tblImportData SET DateValueCol = Cast(Replace (Replace (DateTextCol,'a.m.','am') ,'p.m.','pm') AS DATETIME)
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply