Using the createtime to count items

mrrayj60

Registered User.
Local time
Today, 18:22
Joined
Sep 3, 2009
Messages
103
I need to make a report of the amount of records entered into a table based on shift hours; ie midnight shift entered X records, mornings did x and swing did x total entries for the day = xxx

how do I count using the time, >07:00:00 AM < 03:00:00 PM

Thanks, Ray
 
Make a field in the query, put the data test into an IIF statement and make true = 1 false = 0 and sum the field.
 
Make a field in the query, put the data test into an IIF statement and make true = 1 false = 0 and sum the field.

IIf ( [visitorlog]![createtime] => 07:00:00 am and <= 03:00:00 pm , 1, 0)

gives me invalid syntax
 
You need to put # around a date/time
IIf ( [visitorlog]![createtime] => #07:00:00 AM# and <= #03:00:00 PM# , 1, 0)
 
You need to put # around a date/time
IIf ( [visitorlog]![createtime] => #07:00:00 AM# and <= #03:00:00 PM# , 1, 0)

There is still a Syntax Error here. Both sides of the AND comparison require the Field to test as well as a value to compare it to.

IIf ( [visitorlog]![createtime] => #07:00:00 AM# and [visitorlog]![createtime] <= #03:00:00 PM# , 1, 0)
 
Or you can use the BETWEEN to select inclusively:

IIf ( [visitorlog]![createtime] Between #07:00:00 AM# and #03:00:00 PM# , 1, 0)
 
Or you can use the BETWEEN to select inclusively:

IIf ( [visitorlog]![createtime] Between #07:00:00 AM# and #03:00:00 PM# , 1, 0)

I agree with SOS, and although what I said above is accurate, using BETWEEN is a more appropriate choice.
 

Users who are viewing this thread

Back
Top Bottom