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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

IIf/Where expression in report 1

Status
Not open for further replies.

bikerted

Technical User
Nov 7, 2003
221
GB
I am attempting (and have tried a number of ways e.g. copying part SQL to QBE) to show on my report when a customer has paid more than one donation receipt and has agreed to tax being part of this(called Gift Aid in UK. With an IIf expression, I wanted to indicate the following (which is not correct syntax): IIf([Receipts].[PayeeID]where count of[Receipts].[Receipt] >1, "M",""). Essentially I need to indicate an "M" (for multiple) where Gift Aid is "Yes" and the [PayeeID] has a count of more than one receipt. The report is already set up with Gift Aid at "Yes", so I just need to some how integrate the Where clause if that is possible. Any help will be gratefully received.

Ted.
 
Do you have a count or do you need to get one? If you need a count you can put this:
[tt]=DCount("*","Receipts","[PayeeID]=" & [PayeeID])[/tt]
In a textbox called, say, CountOfPayee, which could then be used in ...

If you already have a count:
[tt]=IIf(CountOfPayee>1 And GiftAid,"M","Whatever")[/tt]

Assuming that GiftAid is boolean.


 
Thanks Remou,

You've given something to think about. Will try it all out tomorrow.

Ted
 
Remou,

The DCount method works admirably - I just needed to define which of two tables [PayeeID] was from, as follows: =DCount("*","Receipts","[PayeeID]=" & [Receipts]![PayeeID]), but I didn't indicate that in my question. Star performance as usual.

Thank you,

Ted.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top