Linked table keeps turning dates into ints

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

Guest

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.
 
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.
 
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top