Linked table keeps turning dates into ints

  • Thread starter Maury Markowitz
  • Start date
M

Maury Markowitz

I have a linked text file with dates in the format "20041130", that is,
yyyymmdd. No matter what I've tried it continues to link them as integers.
Once in this format it seems practically impossible to turn into a "real"
date.

Any advice here? I'd be happy with either...

1) converting the int into a date - no, CDate doesn't work because it's not
a string
2) telling the system how to link it as a date -- the schema.ini already
says it's a date format but it seems Access doesn't care.
 
D

Douglas J. Steele

Assuming you've got the number stored in a variable lngMyDate, and you're
guaranteed that it will always have 2 digit month and day, Format(lngMyDate,
"####/##/##") will convert into a string in yyyy/mm/dd format. CDate will
work with that.
 
M

Maury Markowitz

Douglas J. Steele said:
Assuming you've got the number stored in a variable lngMyDate, and you're
guaranteed that it will always have 2 digit month and day, Format(lngMyDate,
"####/##/##") will convert into a string in yyyy/mm/dd format. CDate will
work with that.

Worked like a champ, thanks! I'll definitely file that one for future
reference.
 
Top