Convert Text to Date

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

What is the most efficient way to convert a text string in the form of
20060218 to a short date? Thanks!
 
Assuming that the field always have the same formt
yyyymmdd

Try
cvdate(format(FieldName,"####/##/##"))
 
AllyOop said:
What is the most efficient way to convert a text string in the form of
20060218 to a short date? Thanks!

Short date is a format, which is irrelevant to the value.

To get a date value from that kind of string:

DateSerial(Left(txtstr,4), Mid(txtstr, 5,2), Right(txtstr,2)

To format the date value set the Format property of the text
box that you're using to display the value.
 
Back
Top