date/time field

G

Guest

i have a date/time field 12/9/2005 9:20:00 AM

i want to extract 3 different fields
month - 12
year - 2005
hour - 09

if it was 9:20 PM
i would want the hour to be converted to 21
 
K

Ken Snell \(MVP\)

Month:
Format(YourDateTimeFieldName, "m")

Year:
Format(YourDateTimeFieldName, "yyyy")

Hour:
Format(YourDateTimeFieldName, "h")
 
D

Douglas J. Steele

Month(MyDateTimeField), Year(MyDateTimeField) and Hour(MyDateTimeField)
respectively
 
G

Guest

fantastic. thanks.

Format(YourDateTimeFieldName, "m")

what would i change to convert the number to text ? (jan, feb, march) ?
 
K

Ken Snell \(MVP\)

Check the Help information for the Format function. It gives all the
different options there.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Update End Date 5
Date and Time 1
TYPE CONVERSION 1
Time - 2 hours (Convert GMT+9 into GMT+7) 1
Update Query 1
Excel Catagorise AM or PM 7
Grouping/Deleting Dates/Times (HELP ANYONE!) 2
Adding times past midnight 5

Top