IIf Statement used for Counting

  • Thread starter Thread starter Vonda
  • Start date Start date
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?
 
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?
 
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?
 
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));
 
Back
Top