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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Date conversion

Status
Not open for further replies.

Luhrern

Technical User
Jul 26, 2002
6
0
0
NO
I have a database where dates is pesented by a 8 position text string i.e. 20020726. What kind (if any) of conversion function in Access can I use to convert this to a date i.e from 20020726 (8 position date format) to 2002.07.26 ?
Regards

Luhrern


 
As the 20020726 format is not a recognised date format in Access, you will need to parse it into a date, e.g.

MyDate=DateSerial(left(text1,4), mid(text1,5,2), mid(text1,7,2))

This will put the date into a date variable (if MyDate is set up as a date variable). You can then set the format of any output to yyy\.mm\.dd to show it the way you want. Have fun! :eek:)

Alex Middleton
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top