Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

access query DATE conversion from text 2

Status
Not open for further replies.

heyjo1

IS-IT--Management
Jun 23, 2004
8
US
i've imported a DBF file where all non-numeric fields are TEXT formatted fields. as such, a typical date field reads like this: 111504 (which represents November 15, 2004)

which access function can i use to make this read like a date, i.e. 11/15/2004, so i can then make DATE caluclations?

i've tried Cdate, DateValue, Date, Date$, etc...and none seem to work.
 
About the only thing you can do is parse the values out of the text string and then convert them
Code:
DateValue = DateSerial (Val(Right(DateString,2)), 
                        Val(Left (DateString,2)),
                        Val(Mid  (DateString,3,2)) )
 
thanks golom for your fast and helpful response! worked like a charm !!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top