Unwanted Brackets

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.
 
G

Gene Wirchenko

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
 
B

Bob Barrows

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.
 

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