IIf Statement used for Counting

V

Vonda

I have written the following statement to count the number of records in a
true statement:

=IIf([Levy]="yes",1,0)

But, what I need to do is expand this statement so it will not count those
records which are true because the record is a duplicate client's name. Does
this make sense?

Can anyone help me?
 
V

Vonda

I am not familiary with the subquery process. What would such a subquery
look like? And, where would the subquery go? Within the report?

KARL DEWEY said:
You have to run a query to separate the dupes first or use a subquery.

Vonda said:
I have written the following statement to count the number of records in a
true statement:

=IIf([Levy]="yes",1,0)

But, what I need to do is expand this statement so it will not count those
records which are true because the record is a duplicate client's name. Does
this make sense?

Can anyone help me?
 
K

KARL DEWEY

Ok, run a query to separate the dupes first.

Vonda said:
I am not familiary with the subquery process. What would such a subquery
look like? And, where would the subquery go? Within the report?

KARL DEWEY said:
You have to run a query to separate the dupes first or use a subquery.

Vonda said:
I have written the following statement to count the number of records in a
true statement:

=IIf([Levy]="yes",1,0)

But, what I need to do is expand this statement so it will not count those
records which are true because the record is a duplicate client's name. Does
this make sense?

Can anyone help me?
 
K

Klatuu

Here is an example of a query that will filter by unique name and count only
those with a True value. If you are using the text value yes, you will need
to change it a bit, but this is the method:

SELECT [_tblClientSave].MainName, Count([_tblClientSave].IsCorporate) AS
CountOfIsCorporate
FROM _tblClientSave
GROUP BY [_tblClientSave].MainName, [iscorporate]=True
HAVING ((([iscorporate]=True)=True));
 

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