Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

If Statement - Two fields... 1

Status
Not open for further replies.

nike2000

Technical User
Apr 1, 2003
61
GB


I have two fields in a query.
They are:

PV_OverTolerance
DeltaOverTolerance

The data in the fields is either 'Yes' or 'No'.
I would like an If statement that would flag 'Warning' if any of the two fields indicated Yes for any record.

Help would be appreciated.
Many thanks,
Nike
 
Hi

SELECT IIf([pot]=-1 Or [dot]=-1,"WARNING","") AS warning
FROM Table1;
Ive called them pot and dot.

Regards Eddie
 
Nike,

Try the following in your SELECT statement...

Code:
SELECT PV_OverTolerance, DeltaOverTolerance, (IIF(OR(PV_OverTolerance=True, DeltaOverTolerance=TRUE),"Warning","OK")) AS Test

Not tested this so let me know how you get on.


Leigh Moore
Solutions 4 MS Office Ltd
 
Nike,

Sorry, using excel syntax.. change to;

(IIF(PV_OverTolerance=True Or DeltaOverTolerance=TRUE,"Warning","OK")) AS Test

Sorry for any confusion.

Leigh Moore
Solutions 4 MS Office Ltd
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top