Filtering on time of day

 

Top  Previous  Next

 

The filter can be used to display only accidents occurring during certain times of day.  To do this, the Time field is used.  Time is stored as a number from 0-2400.

Show all accidents that occurred at 8am

 

1.        Time=800

 

Show all accidents that occurred between 8 and 9 am

 

1.        Time >= 800
2.        Time <= 900

 

another way of obtaining this condition using only one line is:

 

1.        (Time >= 800 ) & ( Time <= 900 )

 

Show all accidents which occurred between 7:30am and 8:30am or 4:30pm and 6pm (rush hour)

 

1.        ((Time >=730 ) & (Time <= 830)) | ((Time >=1630 ) & (Time <= 1800))

 

note that extra parentheses are used to group the two time periods so that they can be compared using the | (or) operator.