group by time IIF expression help (1 Viewer)

dtheo

New member
Local time
Today, 08:37
Joined
Dec 6, 2013
Messages
2
Hello,
I have a Time/Date field in a query which I am trying to group by specific time intervals.

I am able to do this in Excel by making the field into "hmm" text format and then doing the comparison numerically like this
IF(A1<925,8,IF(AND(A1>925,A1<936),9.3,IF(AND(A1>955,A1<1006),10.1,IF(A1>1529,15.1,HOUR((A1/100)/24)))))

How can I do this in Access?

The result I am looking for is to group by the hour of the day except for certain times which I want to distiguish seperately:
<9:25
9:55-10:05
>15:30

Thanks for the help
Damien
 

dtheo

New member
Local time
Today, 08:37
Joined
Dec 6, 2013
Messages
2
i figured it out-
IIf(Format(DatePart("h",[time]),"00") & Format(DatePart("n",[time]),"00") ...use that to make the comparisons.
 

Users who are viewing this thread

Top Bottom