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!

Convert numeric to date/time field 1

Status
Not open for further replies.

charliec

IS-IT--Management
Aug 28, 2001
11
US
I have a dataset with a numeric field that is actually a date. The data is listed as 010828 and I need it to become a date field like 08/28/01. Any suggestions?
 
Try a calculated field like this in your query:

newdt: DateValue(Mid([dt],3,2) & "/" & Right([dt],2) & "/" & Left([dt],2))

where dt is your original field. (looks like based on your data is text, because it has a leading zero - so that's what this calculation assumes)

If you actually need to update the data in your table, you could create a new date field in the table & use an update query to update the new field using the calculation above.

J. Jones
jjones@cybrtyme.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top