Unwanted Brackets

  • Thread starter Thread starter croy
  • Start date Start date
C

croy

I'm having trouble with this in a query:

Bad_Code: IIf(([CWTnum1-3]="" And
[CWTnum1-1]=”100000”),[CWTnum1-1])

The goal is: If [CWTnum1-3] is a zero-length string AND
[CWTnum1-1] contains "100000" , then use the value in
[CWTnum1-1].

Access keeps throwing brackets around the second criteria
Bad_Code: IIf(([CWTnum1-3]="" And
[CWTnum1-1]=[”100000”]),[CWTnum1-1])

Any help appreciated.
 
I'm having trouble with this in a query:

Bad_Code: IIf(([CWTnum1-3]="" And
[CWTnum1-1]=”100000”),[CWTnum1-1])

The goal is: If [CWTnum1-3] is a zero-length string AND
[CWTnum1-1] contains "100000" , then use the value in
[CWTnum1-1].

Access keeps throwing brackets around the second criteria
Bad_Code: IIf(([CWTnum1-3]="" And
[CWTnum1-1]=[”100000”]),[CWTnum1-1])

Any help appreciated.

iif() takes three parameters. You only have two.

Sincerely,

Gene Wirchenko
 
Gene said:
I'm having trouble with this in a query:

Bad_Code: IIf(([CWTnum1-3]="" And
[CWTnum1-1]="100000"),[CWTnum1-1])

The goal is: If [CWTnum1-3] is a zero-length string AND
[CWTnum1-1] contains "100000" , then use the value in
[CWTnum1-1].

Access keeps throwing brackets around the second criteria
Bad_Code: IIf(([CWTnum1-3]="" And
[CWTnum1-1]=["100000"]),[CWTnum1-1])

Any help appreciated.

iif() takes three parameters. You only have two.
Only in VBA code. In a query, it accepts two, returning Null if the third
argument is not supplied and the test condition is false.

I don't believe this is relevant to the OP's symptom, which I've never
before encountered.
 
Back
Top