number to date

seat172

Registered User.
Local time
Yesterday, 18:45
Joined
Jun 30, 2004
Messages
25
Hi, i have a linked table where the date is stored as a number, can't change the format as it's an export file from an old system. The date is held thus: 20040629, for the 29th June 2004. I need to change this to a usable date to enable me to perform days since calculations. i am sort of half way there using format dateserial. But i am obviously missing something.

Any help appriciated.

Many Thanks
 
Last edited:
seat,

If xxx = "20040629" then this should work.

CDate(Mid(xxx, 5, 2) & "/" & Mid(xxx, 7, 2) & "/" & Mid(xxx, 1, 4))

Wayne
 
Or:

DateSerial(Mid([Field], 1, 4), Mid([Field], 5, 2), Mid([Field], 7, 8))
 
Thanks guys both worked a treat, can go on holiday and relax thanks to you. :)
 

Users who are viewing this thread

Back
Top Bottom