The Use of IIF Statement with Multiple Conditions

adewale4favour

Registered User.
Local time
Today, 14:04
Joined
Aug 9, 2019
Messages
58
Hi Guys,
I am presently working on an application and forms have been developed to handle data entry for the individual users. But there is a need to track a field, which should be disabled for users and get the information entered based on what the users populate in two related fields. For instance, If Field A is "Non Operational" and Field B is greater that 14, then field C must be "Inactive". I tried using nested If conditions as below.
iif([STATUS]="NON OPERATIONAL" AND [DueEstimate] > 14,[COUNT_FIELD] = "Inactive", "")

Please help evaluate this, perhaps there is something I am getting wrong, the above iif statement get me weird.
 
Just take out the '[COUNT_FIELD]=' part.
 
The expression would calculated in the query and be something like:

Select iif([STATUS]="NON OPERATIONAL" AND [DueEstimate] > 14, "Inactive", "Somethingelse") AS [COUNT_FIELD], fld2, fld3, etc
From ...
Where ...

It is poor practice to store values that can easily be calculated. Please do some reading on database normalization.
 

Users who are viewing this thread

Back
Top Bottom