How to convert number to date

wgma

Registered User.
Local time
Today, 08:25
Joined
Nov 19, 2007
Messages
72
I have a number, 20080101, that I need to convert to 01/01/2008.

How do I do this? I am not familiar enough with access to know.

Thanks.
 
cdate(mid(mystr,5,2) & "/" & right(mystr,2) & "/" & left(mystr,4))
 
WOW! that was fast.

Thanks.
 
Send cash - :)

(just kiddin - glad to help)
 
or (assuming digits 5&6 are the month)...

DateSerial(Left(mystr,4),Mid(mystr,2,2),Right(mystr,2))

Chris
 
cdate(mid(mystr,5,2) & "/" & right(mystr,2) & "/" & left(mystr,4))

Hi Mr KenHigg..... please, what if I have 3 fields into 1 table, with NUMERIC data type: month, day, year...... but the month has only 1 digit....and I want to convert to date???
For exmaple, I have 28 - 9 - 2009 on the 3 numeric fields.
I have tried using cdate(mid,right,left) but does not work.....
What if I have Month: 10, Day:3, Year:2009?
Thanks in advance from COLOMBIA !!!!!
 
Bienvenidos.

When they are separate fields:
DateSerial([yearfieldname], [monthfieldname], [dayfieldname])
 

Users who are viewing this thread

Back
Top Bottom