iif logic

  • Thread starter Thread starter Guest
  • Start date Start date
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.
 
Try:

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