Counting entries in a report

ptaylor-west

Registered User.
Local time
Today, 07:20
Joined
Aug 4, 2000
Messages
193
I am really brain dead with this one - I want to create a report from a query which has 3 fields - One is the Job No the next is the priority and the last is Completed. The first should be simple I have used the Count function in the cointrolsouce of a text box on the report to add up how many job number there are. For the priority field ( which is a 1 to 5 range) I thought to use a number of text boxes and use DCount to give me a total for those with the criteria 1 and so on the next one for 2 etc. but no matter how much I try i can't see how to set this criteria. lastly the completed field is a tick box - again I thought to use DCount but I am have the same problems setting the criteria.

Having messed with this for a few hours I am sure that I am going about it the completely wrong way and would ask for your help in putting me back on the rails please.
 
Try:

DCount(...,"Priority = 1")
DCount(...,"Completed = True")

You could also have a textbox in the report footer with a control source like:

=Sum(IIf(Priority = 1,1,0))
 
Tried your suggestions but none of them work - I presume the ..., is the field name - but it doesn't recognise it, maybe I am using the wrong format.

The Iif says it not the correct parameters.

Priority has a range of 1 to 5 so I thought I could put five textboxes to count the number for each rating - that's what I am after.

many thanks for responding
 
Well, the "..." was meant to replace the other parts of the DCount, which would be both the field name and the domain (table or query) name. I think Help may describe all three parts.

The Sum/IIf works presuming the fields are correct. Just tried this in a test db:

=Sum(IIf([pass]=-1,1,0))

Maybe you could post a sample db?
 
Thanks I used the help for the other parts and it works fine. I moved on since then to try and use a number of querys to filter the totals and then made a query of queries (if you see what I mean) I then created the report on the final query which was much easier as I also needed to select by a date range as well which was much easier to do so in the queries.

Many thanks for your help in pointing me in the right direction

Paul
 

Users who are viewing this thread

Back
Top Bottom