Can I convert a string "DD:MM:YYYY" to a DATETIME field during a bcp ?
Posted on 2002-03-12
I've got a comma seperated file ...
My table is like so...
I need to 'bcp' the file containing these rows of comma seperated fields with '\n' as a row terminator.
When I try...
'bcp db.owner.table in file -U -P -c -t , -r \\n'
It will not work as I get an error on the second field (the dd:mm:yyyy). I know this date field should be like yyyy:mm:dd but this 'cannot' be changed !
Is it possible during my bcp to actually convert this string dd:mm:yyyy into a format that can be inserted into a Sybase DATETIME type ?
Remember, I need to bcp the whole file (i cannot read each line of the file and convert the date string) as is.
Also, the field in the database needs to be a DATETIME, I can't just use a char here as I need to be able to sort by date (and I can't sort on dd:mm:yy) :(