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!

Pulling out certain data from a date/time field

Status
Not open for further replies.

Lorimare

MIS
Dec 9, 2003
24
0
0
US
I have a table that stores date/time as:(example): 7/13/2004 2:06:04 AM

This is how the date/time is stored. Im trying to build a query and want to pull only certain parts of that field. What I need is the date and the hour only...so I need:
7/13/2004 2AM

Do I need to do a left or right of? such as Left([DateTime],11,19)

Thanks for the help.
 
Have you tried the Format function ?
Format([DateTime], "m/dd/yyyy hAM/PM")

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top