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

Changing Dates in Access

Status
Not open for further replies.

doorok

Technical User
Mar 20, 2003
10
0
0
US
I'm querying my corporate database in access and I have run into problems with the way my db outputs dates. When I have a date field the dates are display as yyyymmdd or February 22, 2003 would be 20030122. This makes it impossible for me to perform calculations on the dates. Does anyone know how I can get access to convert this format to mmddyyyy?

Thanks
 
February 22, 2003 would be 20030222.

Funny...Have you checked the Format property in the tables, forms and reports? You may find something like:
"yyyymmdd"

Just delete the format and you're (almost) set.

Good luck
[pipe]
Daniel Vlas
Systems Consultant
 
Are you sure your corporate db is not just returning dates as text?

You could write a little function to convert the text version to a real date in access. Something like:

function StrToDate(strDate as string) as date
StrToDate = Mid(strDate, 5, 2) & "/" & Right(strDate, 2) & "/" & Left(strDate, 4)
end function

Any Access Guru's out there with a more elegant solution?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top