IIF condition

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a query which returns record information from several fields. If a certain check box control [RFSrequired] is checked yes in a record, the query is set up to not return the particular record; if it is unchecked, the record is returned upon running the query

I would like to modify this query so that if another control box [Dateorderrcvd] in the record is not null, then a record with the [RFSrequired] checked yes would be nevertheless be returned

I’m thinking this would require an expression using IIF and & put in a criteria box in the query builder screen, but this general sense of what to do is a long way from producing satisfactory results

Any suggestions would be appreciated

Rick Kani
 
RickK said:
I have a query which returns record information from several fields. If a certain check box control [RFSrequired] is checked yes in a record, the query is set up to not return the particular record; if it is unchecked, the record is returned upon running the query.

I would like to modify this query so that if another control box [Dateorderrcvd] in the record is not null, then a record with the [RFSrequired] checked yes would be nevertheless be returned.

I’m thinking this would require an expression using IIF and & put in a criteria box in the query builder screen, but this general sense of what to do is a long way from producing satisfactory results.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


You'd use OR & AND in the WHERE clause.

I don't usually use the QBE display to create the query selection
criteria, I use the SQL view. So here is the answer in a WHERE clause
in the SQL view.

SELECT ...
FROM ...
WHERE RFSrequired = False
OR (DateOrderRcvd Is Not NULL AND RFSrequired = True)

- --
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQFPCqoechKqOuFEgEQKQhQCgwPgtQtAWhMWOsV+DJG78PmpWW1gAn2EB
C+wdws2dFgJIjF4NWCfH+WMz
=QJGs
-----END PGP SIGNATURE-----
 
I second the motion. Working with formal logic is difficult enough,
and doing so in the design grid can make it almost impossible,
especially when to do so would mean repeating some of the logic over
and over unnecessarily, when judicious use of parentheses is all that
is needed.

Tom Ellison
Microsoft Access MVP
Ellison Enterprises - Your One Stop IT Experts


RickK said:
I have a query which returns record information from several fields. If a certain check box control [RFSrequired] is checked yes in a record, the query is set up to not return the particular record; if it is unchecked, the record is returned upon running the query.

I would like to modify this query so that if another control box [Dateorderrcvd] in the record is not null, then a record with the [RFSrequired] checked yes would be nevertheless be returned.

I’m thinking this would require an expression using IIF and & put in a criteria box in the query builder screen, but this general sense of what to do is a long way from producing satisfactory results.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


You'd use OR & AND in the WHERE clause.

I don't usually use the QBE display to create the query selection
criteria, I use the SQL view. So here is the answer in a WHERE clause
in the SQL view.

SELECT ...
FROM ...
WHERE RFSrequired = False
OR (DateOrderRcvd Is Not NULL AND RFSrequired = True)
 
Back
Top