How do i convert yyyy_mm_dd strings to proper dates in Access?

D

Duane Hookom

Feel free use the large white space below the subject line to enter your
question.

Take a look at these functions:
Mid()
Left()
Right()
CDate()
Replace()

Just one of many possible solutions is
cdate(Replace(YourStringDate ,"_","-"))
 
J

John Vinson

It's considered polite to post your question in the text area, not
just the subject line.

That said...

DateSerial(Left([datestring], 4)), Mid([datestring], 6, 2),
Right([datestring], 2))

should do it for you.

John W. Vinson[MVP]
 
R

Randy Harris

John Vinson said:
It's considered polite to post your question in the text area, not
just the subject line.

That said...

DateSerial(Left([datestring], 4)), Mid([datestring], 6, 2),
Right([datestring], 2))

should do it for you.

John W. Vinson[MVP]


John, I think you might have gotten an extra ')' in there.

DateSerial(Left([datestring], 4), Mid([datestring], 6, 2),
Right([datestring], 2))
 
J

John Vinson

John, I think you might have gotten an extra ')' in there.

Thanks Randy - quite right!

I think it slipped in from the LISP compiler...

John W. Vinson[MVP]
 
T

Tolga Uzuner

John said:
Thanks Randy - quite right!

I think it slipped in from the LISP compiler...

John W. Vinson[MVP]
Many thanks to everyone for their kind replies, and noted re posting msg
into the body of the email.
Regards,
Tolga
 
Top