Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

count(iif,iif,value) is this and if? if so how do I do or if

Status
Not open for further replies.

Triacona

Technical User
Jun 11, 2009
462
GB
Dear All,
Thanks for a great forum.
I have trawled the internet and found nothing I can relate to my problem.

I have a quarterly report for PS returns.
I have the following code to count if [DTYPNUMBCO] = "0013" etc.
But I want to count if the [DTYPNUMBCO] = 0013 or if the PPA is Y or if EIA = "Y" or if the Ext = "Y"
Code:
=Count(IIf([DTYPNUMBCO]="0013",IIf([PPA]="Y",IIf([EIA]="Y",IIf([ExtTime]="Y",0)))))
so I want it to definitely test if it is the correct [DTYPNUMBCO] but the other counts are optional [PPA]/[EIA]/[ExtTime] (only if the condition is met)

Any help would be really appreciated [thumbsup]





Thank you,

Kind regards

Triacona
 
Provide some sample data with the desired results.

I expect you are better off summing a true/false expression rather than counting.

Something like
SQL:
Sum(Abs([Color]="Green" AND ( Type="Shirt" or Size = "XXL")))

Duane
Hook'D on Access
MS Access MVP
 
Thanks I will try the Sum approach.
Thanks again [smile]

Thank you,

Kind regards

Triacona
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top