Thek said:
In my Access Database, I have a date in a field with Data Type
Number(Long Integer) in Access. I need a function to convert this
Long Integer to a regular Date Format (mm/dd/ccyy)
How is the data represented in the Long Integer field? If it's in
mmddyyyy format (e.g., today as 02172006), then you could use an
expression like this:
CDate(Format([YourField], "00/00/0000"))
For example, in the Immediate Window:
?CDate(Format(02172006, "00/00/0000"))
2/17/2006
If your date is represented as yyyymmdd, then use
CDate(Format([YourField], "0000/00/00"))
For example:
?CDate(Format(20060217, "0000/00/00"))
2/17/2006
This may be dependent on your regional date format, as defined in
Control Panel. I'm not sure, but you can test to find out easily
enough.