lunamuna Posted April 9, 2002 Share Posted April 9, 2002 I'm trying to get text, date, and time fields into a text single. Everything works fine, but I want time displayed as "hh:mm AM/PM", it comes out in 24 hour notation w/o AM or PM. Does anyone know how to get 12 hour notation? -Heather Link to comment Share on other sites More sharing options...
kenneth2k1 Posted April 9, 2002 Share Posted April 9, 2002 If you go to Format/Time, there is an option to put it in 24 or 12 hour notation, or format as you specify. Is that what you are looking for? Ken Link to comment Share on other sites More sharing options...
lunamuna Posted April 9, 2002 Author Share Posted April 9, 2002 No, I'm trying to incorporate the time field into the body of an email, so it needs to be in text format in a text field, mixed with several other types of data. Any ideas? Link to comment Share on other sites More sharing options...
RussBaker Posted April 9, 2002 Share Posted April 9, 2002 Heather, Use this calculation for the text of a field called "Time": code: if(Hour(Time) > 12, Hour(Time)-12&":"&Right("00"&Minute(Time),2)&"PM",Hour(Time)&":"&Right("00"&Minute(Time),2)&"AM") This will give you single hour figures for hours less than 10. IF you want a leading zero for the hours then use: code: if(Hour(Time) > 12, Right("00"&Hour(Time)-12,2)&":"&Right("00"&Minute(Time),2)&"PM",Right("00"&Hour(Time),2)&":"&Right("00"&Minute(Time),2)&"AM") You can include this if statement in the middle of whatever else you are using to produce your final text string. Russ [ April 08, 2002, 07:38 PM: Message edited by: Russell Baker ] Link to comment Share on other sites More sharing options...
lunamuna Posted April 9, 2002 Author Share Posted April 9, 2002 Worked like a charm. Thanks Russ! Link to comment Share on other sites More sharing options...
Recommended Posts
This topic is 8054 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now