Link to home
Start Free TrialLog in
Avatar of fireprograms_tech
fireprograms_techFlag for United States of America

asked on

Need to calculate the number of events that occurred with in time frames during the day

We have a database field that is a date/time field named AlarmDate.  I need a formula to look at the time in this field and determine if it is between 6am and 5:59:59pm or if it is between 6pm and 5:59:59am so that I can count the number of events that occurred in each time frame
ASKER CERTIFIED SOLUTION
Avatar of vasto
vasto
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
You create two formula fields :

If Hour({table.alarmdate})>=6 and Hour({table.alarmdate})<18 then 1 else 0



If Hour({table.alarmdate})<6 or Hour({table.alarmdate})>=18 then 1 else 0


Save each field with a meaningful name.

Then you just use Insert>Summary (twice) to Sum each of these fields.
Avatar of fireprograms_tech

ASKER

Thank you so much this was a great solution