July 3, 2007 at 11:45 am
i have to import some tax data everymonth and in the past the date time data in one of the files looked like
20070101
this month they changed it to 01/01/2007 format. unfortunately the column in the table is a varchar(8) to handle the old data.
is there any way to transform this without changing the table?
July 3, 2007 at 1:17 pm
Is the date sent to you as text?
If so, and it always has the format MM/DD/YYYY you could do something like this:
select right(datefield,4)+left(datefield,2)+substring(datefield,4,2)
Michelle
July 3, 2007 at 1:50 pm
thx, i'll try that if need be
for now we just changed it to varchar(10) and told our devs and billing people to check it and make sure it's OK. will have to wait and see what they say.
July 3, 2007 at 2:23 pm
It is a bad design to store a date in a non-datetime column.
If you are going to change it to anything, change it to a data type of datetime.
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply