I have a question about using an IIF statement with a Yes/No field. In my case, I am trying to get the statement do one thing if the Yes/No field=Yes and another if it is "No." I realize Access stores the Yes/No field as -1,0 and have attempted to formulate the statement this way.
I did make this statement:
NetDonation: IIf([PickupRequired]-1,[DonationValue]-8.75, 0, [DonationValue])
Unfortunately, this statement does not differentiate between the PickupRequired field being "No" or "Yes" and it subtracts 8.75 from all values regardless if the PickupRequired field = No.
IIf()
will recognize Yes/No
fields as True
or False
without your having to specify a numeric value, so the following will work just fine
IIf([PickupRequired], "The value is Yes", "The value is No")
In your particular case I suspect that you want
NetDonation: [DonationValue] - IIf([PickupRequired], 8.75, 0)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With