Sorting Military time for shift 23:00 to 07:00

C

command_lt

I am putting together a report which list activity from 23:00 hours to 07:00
hours. My problem is sorting it by time. I would like to to be 23:00 hours
first then start 00:00 second. In my report I can only go ascending which
puts all times 23:00 last
if I go decending I get midnight last. Is there someway around this on
report without creating a field for numbering entries
 
M

Marshall Barton

command_lt said:
I am putting together a report which list activity from 23:00 hours to 07:00
hours. My problem is sorting it by time. I would like to to be 23:00 hours
first then start 00:00 second. In my report I can only go ascending which
puts all times 23:00 last
if I go decending I get midnight last. Is there someway around this on
report without creating a field for numbering entries


You need some kind of day indicator. Sorting can't tell if
2300 is late tonight or last night. This is not an issue if
you use full date/time values but just a time value is
ambiguous.

OTOH, you could use some kind of funky expression to sort
the times. E.g. sort by:
=Iff(timevalue < #23:00#, timevalue + 1, timevalue)
 
D

Damian S

Hi command_lt,

Off the top of my head, a quick and dirty fix for you in this specific case
would be to sort on the time field + 2 hours... that would put 2300 first,
followed by 0000, then 0100 etc...

Not pretty, but it will work in this instance!!

Damian.
 
C

command_lt

Thanks for your help I'll give it a try

Marshall Barton said:
You need some kind of day indicator. Sorting can't tell if
2300 is late tonight or last night. This is not an issue if
you use full date/time values but just a time value is
ambiguous.

OTOH, you could use some kind of funky expression to sort
the times. E.g. sort by:
=Iff(timevalue < #23:00#, timevalue + 1, timevalue)
 
C

command_lt

Thank you for your help I'll give it a try

Damian S said:
Hi command_lt,

Off the top of my head, a quick and dirty fix for you in this specific case
would be to sort on the time field + 2 hours... that would put 2300 first,
followed by 0000, then 0100 etc...

Not pretty, but it will work in this instance!!

Damian.
 

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

Top