Parsing Dates at Import

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a dat file (which I am changing to a txt format before import) in
which the customer sends date fields in the following format

061231061201

This is two dates 12/31/06 & 12/01/06, Unfortunately it's in European
format. I'm using a schema to import this text file, and was wondering
whether there was a way to import these into date format (I'm making them two
separate fields, it's fixed width). I tried changing the Date drop down box
to YMD, but it didn't work.
 
I have a dat file (which I am changing to a txt format before import) in
which the customer sends date fields in the following format

061231061201

This is two dates 12/31/06 & 12/01/06, Unfortunately it's in European
format. I'm using a schema to import this text file, and was wondering
whether there was a way to import these into date format (I'm making them two
separate fields, it's fixed width). I tried changing the Date drop down box
to YMD, but it didn't work.

Make life easy on yourself. Just dump the dates into a temporary
table and then use a query to twist them into the shape you want.
This stuff is child's play.

YY,MM,DD,YY,MM,DD
YrStart=Cint(left$(MyString,2))
MonthStart=Cint(Mid$(MyString,3,2))
DayStart=Cint(Mid$(MyString,5,2))
YrEnd=Cint(Mid$(MyString,7,2))
MonthEnd=Cint(Mid$(MyString,9,2))
DayEnd=Cint(Mid$(MyString,11,2))

Then just use DateSerial to convert them...
 
Back
Top