H
Hugh Welford
Hi - I am trying to include a conditional WHERE into an ACCESS query using
IIF, with the false-part a wildcard.
The expression SELECT details.patid, details.type FROM details WHERE
(((details.type)=IIf(1=1,2,(details.type) Like "*"))); returns all records
with type = 2, but
SELECT details.patid, details.typeFROM detailsWHERE
(((details.type)=IIf(1=2,2,(details.type) Like "*"))); returns NO records.
However, the unconditional expression SELECT details.patid, details.type
FROM details WHERE (((details.type) Like "*")); returns ALL records.
Can anyone help me with this?
Thanks Hugh
IIF, with the false-part a wildcard.
The expression SELECT details.patid, details.type FROM details WHERE
(((details.type)=IIf(1=1,2,(details.type) Like "*"))); returns all records
with type = 2, but
SELECT details.patid, details.typeFROM detailsWHERE
(((details.type)=IIf(1=2,2,(details.type) Like "*"))); returns NO records.
However, the unconditional expression SELECT details.patid, details.type
FROM details WHERE (((details.type) Like "*")); returns ALL records.
Can anyone help me with this?
Thanks Hugh