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,(de tails.type) Like "*"))); returns all records
with type = 2, but
SELECT details.patid, details.typeFRO M detailsWHERE
(((details.type )=IIf(1=2,2,(de tails.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,(de tails.type) Like "*"))); returns all records
with type = 2, but
SELECT details.patid, details.typeFRO M detailsWHERE
(((details.type )=IIf(1=2,2,(de tails.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
Comment