iif logic

G

Guest

I am having trouble with an if statement. My logic steps are

1. If amount is < 0 (want any negative amounts)
2. AND type = AC OR type = AT
3. THEN Amount
4. ELSE 0

IIf(amount<0 And (type="AC" OR type="AT"),amount,0))

Does the statement above look correct for an Access SQL query? I am not
getting the results I had expected... I am getting zeros when I know I have
amounts less than 0.
 
K

kingston via AccessMonster.com

Try:

IIF(Amount<0,IIF(Type="AC",Amount,IIF(Type="AT",Amount,0)),0)
 

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