criteria in a query, if/then statement

S

soniaariana

I am trying to write an if/then statement. I have this so far"
=IIf([Tax Escrow]="No",[Taxes]/12). It keeps giving me errors. I am
trying to get an empty field in a table labeled "tax pmt" to calculate
by the following: if the [Tax Escrow] field is check marked "No" then
divide the [Taxes] by 12. Any suggestions?
 
D

Douglas J. Steele

The IIf statement needs 3 parameters: the first one's a boolean expression,
the second one is the value to use if the boolean expression is True, and
the third one is the value to use if the boolean expression if false.

As well, while they may be called Yes/No fields in Access, they really are
Boolean fields, so they're actually storing True and False, not "Yes" and
"No".

Assuming you want the value of the field as is if Tax Escrow is false, try:

=IIf([Tax Escrow]=True, [Taxes]/12, [Taxes])
 
E

edgar fonseca

soniaariana said:
I am trying to write an if/then statement. I have this so far"
=IIf([Tax Escrow]="No",[Taxes]/12). It keeps giving me errors. I am
trying to get an empty field in a table labeled "tax pmt" to calculate
by the following: if the [Tax Escrow] field is check marked "No" then
divide the [Taxes] by 12. Any suggestions?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top