Convert String to Date

  • Thread starter Thread starter Chris
  • Start date Start date
C

Chris

I have been given a table with "visit_date" stored as text as follows:

29MAY2009
19JUN2009
06FEB2009
06MAR2009
06FEB2009

I need to convert data to a date field in a query.

Thanks.

Christine
 
Try

DateValue(Format("29MAY2009","@@ @@@ @@@@"))
Or
CDate(Format("29MAY2009","@@ @@@ @@@@"))

To keep errors at bay you might try

IIF(ISDate(Format([Visit_Date],"@@ @@@ @@@@"))
,CDate(Format([Visit_Date],"@@ @@@ @@@@")),Null)

John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
 
Back
Top