By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,224 Members | 1,143 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,224 IT Pros & Developers. It's quick & easy.

Convert military time to 12 hour time

P: 8
I have data in this format 0800, 1730, 0930, etc.
I do not know how to convert this time to read something like, 8:00AM, 5:30 PM, 9:30AM etc.
Also I want to group things by day. I have courses taken on different days of the week at different time. E.g. Math02 on Wednesday at 8:30 AM to 11:30AM.
So I want to show Time of Day, (eg 6:30 AM - 9:00 AM) Day (eg Monday) ad group the courses taken by day and time.
Please assist
Thanks
O
Aug 31 '07 #1
Share this Question
Share on Google+
1 Reply


missinglinq
Expert 2.5K+
P: 3,532
Time is actually stored in Access as, well, time! How it'd displayed depends on how it's formatted.
Short Time (also known as Military time) would be 14:12
Medium Time would be 02:12 PM
Somewhere, either in the table definitions or in the form itself, your times are formatted as Short time. You can change this by changing the format to Medium Time in the table definitions, in the control's property box in the form, or in VBA code
Expand|Select|Wrap|Line Numbers
  1.   Format(YourTime, "HH:MM")  'yields 14:12
  2.  Format(YourTime, "HH:MM ampm")   'yields 02:12 PM
As for sorting /displaying classes, assuming you have a record for each class, in your query, make sure Day of Class is to the left, in the Query Grid, of the Time of Class, and sort by both.

Linq ;0)>
Aug 31 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.