Count with clauses

sir_dan_mitchell

Registered User.
Local time
Today, 23:18
Joined
Feb 5, 2002
Messages
74
hi guys,

im looking to count certain values in my report. I have a field that contains 4 values, Emergency, Elective, Maternity and other. I want to use a count facility to count how many emegency, elective etc.

I have created a text box yadayada and the count works, but not with a WHERE or it seems any other type of clause.

=count([FIELD]) WHERE ([FIELD]) = "Emergency" dont work and ive tried many other ways too!

Help meee
 
Use a count query and base your report on the query. In the query grid do the following:

your field name
group by

your field name
count

Criteria (Count *)

HTH
Hay
 
im being really stupid here, but how can you have group by and count in the same grid?

my field name is FIELD1
 
it kind of helps yeah,

however I have this field that contains 4 different things. I want a total of EACH! if i put a where condition in, then only one of those fields can be worked with!

also in the report would i then do another count of all those that match my criteria, as currently it only gives the value of '1'.

Dan
 
I use Dcount for the same thing in a db I am currently working on it looks something like

=DCount("[CategoryID]","tblProspects","[CategoryID] = 1")

I can send you the report which uses a combination of the count query via subreports and Dcount?
 
Hi Dan

Can you give me a second as I'll need to take out all the confidential stuff (not that I don't trust you or anything) but the company might have something to say about that.

What version of access are you using?

Hay
 

Users who are viewing this thread

Back
Top Bottom