Count function

S

shaka

Hi folks looking for a little help here

I have a database with fields start time - finish time - time (this
field calculates the time difference between start and finish)

what i am trying to achieve is a report footer that will tell me how
many times are more than 30min - between 20-30 min 10-20min etc

any help would be very much appreciated

thanks
shaka
 
D

Dale_Fye via AccessMonster.com

Recommend against the computed Time column. This can be calculated at any
point in time via a query. Actually, I'd probably include these additional
columns in the query as well, something like:

Query1
Select [Start Time], [Finish Time],
DateDiff("n", [Finish Time], [Start Time] as ElapsedMinutes
FROM yourTable

Then I'd do Query2
SELECT [Start Time], [Finish time], ElapsedMinutes,
IIF(ElapsedMinutes <10, 1, 0) as "Less than 10",
IIF(ElapsedMinutes >=10 and ElapsedMinutes <20, 1, 0) as "10 to
20",
IIF(ElapsedMinutes >=20 and ElapsedMinutes <30, 1, 0) as "20 to
30",
IIF(ElapsedMinutes >=30, 1, 0) as "30 or more"
FROM Query1

Then, in the report, include the durations, but hide them
Then, in the footer, add a couple of text boxes and set their controls source
like:

=Sum([Less than 10])
or
=Sum([10 to 20]

HTH
Dale
 

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