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

Date/Time Field to Text in Specific Format 1

Status
Not open for further replies.

PavelJHH

Technical User
Aug 13, 2007
1
US
I want to translate a date/time field to a text field in a specific format. For example, 8/13/2007 10:38 a.m. will become 200708131038, format YYYYMMDDhhmm with hours in 24-hour clock format. I believe there is a FORMAT command which can be used in a query to accomplish this but don't remember the exact layout of the command.

Thanks for any help you can give.


Paul
 
You have answered you own question....[smile] You can also always search in help.

Format(value, formatdesc)

so

Format(mydate, "yyyymmddhhnn")

=======================================
People think it must be fun to be a super genius, but they don't realize how hard it is to put up with all the idiots in the world. (Calvin from Calvin And Hobbs)

Robert L. Johnson III
CCNA, CCDA, MCSA, CNA, Net+, A+, CHDP
VB/Access Programmer
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top