|
tech
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
IIf Statement used for CountingI 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? You have to run a query to separate the dupes first or use a subquery.
Show quoteHide quote "Vonda" wrote: > 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? Show quoteHide quote "KARL DEWEY" wrote: > You have to run a query to separate the dupes first or use a subquery. > > "Vonda" wrote: > > > 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.
Show quoteHide quote "Vonda" wrote: > 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" wrote: > > > You have to run a query to separate the dupes first or use a subquery. > > > > "Vonda" wrote: > > > > > 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)); -- Show quoteHide quoteDave Hargis, Microsoft Access MVP "Vonda" wrote: > 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?
junction table setup
Starting Point for Access 2003 database Copy Field Data Report in Legal size Table Set-up How do I set up a column to populate... loading Access when I already have a 2007 student Office pkg loade BIRTHDAY MAIL SHOT multiple users updating the same table and sharing Daily download |
|||||||||||||||||||||||