Bad Syntax in built expression

D

Divine Mrs. M

This is information needed:
If Qual=A, an dif (Transaction Amount/100) is less than highest CEM then
“Eligibleâ€
If Qual=L, and if Transaction Amout is less Qualifier, then “Eligibleâ€
If Qual=M, and if Transaction Amount is less Qualifier, then “Eligibleâ€
If Qual=N, and if (Transaction Amount/100) is less than highet CEM then
“Eligibleâ€
________________________________________________________________--
Query Sample:

Expr2: IIf([Immed Credit]![Qual Code]="A" Or "N" And [Immed Credit]![Total
Tran Amt]/100<[Immed Credit]![Cust 1 CEM] or [Immed Credit]![Cust 2 CEM] or
[Immed Credit]![Cust 3 CEM] or [Immed Credit]![Cust 4 CEM] or [Immed
Credit]![Cust 5 CEM] then "Eligible","yes")
 
V

Van T. Dinh

* IIf() requires 3 arguments and your expression has 2.

* You cannot use:

[Immed Credit]![Qual Code]="A" Or "N"

You need to use:

([Immed Credit]![Qual Code]="A") Or
([Immed Credit]![Qual Code]="N")

* You have an huge Boolean expression combining And and Or without using
brackets to indicate the correct order of operation. Most likely, Access
will interpret this incorrectly.

Check Access Help on IIf() function.
 
P

peregenem

Van said:
* IIf() requires 3 arguments and your expression has 2.

* You cannot use:

[Immed Credit]![Qual Code]="A" Or "N"

You need to use:

([Immed Credit]![Qual Code]="A") Or
([Immed Credit]![Qual Code]="N")

Would this work:

[Immed Credit]![Qual Code] IN ('A', 'N')
 
V

Van T. Dinh

IN should be OK ...

I tend to use or if there are only 2 items and use IN for more than 2 as Or
is a bit clearer (in my mind, anyway).

--
HTH
Van T. Dinh
MVP (Access)



* IIf() requires 3 arguments and your expression has 2.

* You cannot use:

[Immed Credit]![Qual Code]="A" Or "N"

You need to use:

([Immed Credit]![Qual Code]="A") Or
([Immed Credit]![Qual Code]="N")

Would this work:

[Immed Credit]![Qual Code] IN ('A', 'N')
 

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

Similar Threads


Top