Hi everyone -
I am trying to store a field in an Access 2000 table that is defined as a "Short Date".
I started out with a nine digit number (called CourseDate, defined as "double" that looks like this: 103021603. I stripped off the first 3 digits using:
DateNum = Right(CourseDate, 6)
(I've tried defining DateNum as both a string and a long variable, and the results are the same: 021603). So far, so good!
Now I want to convert 021603 to a date that will be eventually be stored as a short date meaning February 16, 2003. I am using:
dtDate = DateValue(DateNum)
I get a "type mismatch" error on the above statement. I have tried defining dtDate as both a date and a variant, but I get the error either way.
How can I go from my original 9 digit "double" number to a valid short date format?
Thanks in advance for your help...
- Anita
I am trying to store a field in an Access 2000 table that is defined as a "Short Date".
I started out with a nine digit number (called CourseDate, defined as "double" that looks like this: 103021603. I stripped off the first 3 digits using:
DateNum = Right(CourseDate, 6)
(I've tried defining DateNum as both a string and a long variable, and the results are the same: 021603). So far, so good!
Now I want to convert 021603 to a date that will be eventually be stored as a short date meaning February 16, 2003. I am using:
dtDate = DateValue(DateNum)
I get a "type mismatch" error on the above statement. I have tried defining dtDate as both a date and a variant, but I get the error either way.
How can I go from my original 9 digit "double" number to a valid short date format?
Thanks in advance for your help...
- Anita