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

  • Thread starter Thread starter Guest
  • Start date Start date
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 ,"_","-"))
 
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 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))
 
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]
 
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
 
Back
Top