Query Design

kitty77

Registered User.
Local time
Today, 02:14
Joined
May 27, 2019
Messages
719
How would I write the following...
Status: If [results] like "*pass*" then "Y", if [results] like "*fail*" then "N"

I'm using this in the query design.
 
What other values are possible? Pass and Fail are not the complete strings, they are embedded in longer strings?

Status: IIf([results] LIKE "*pass*", "Y", "N")
 
That works, however, I need it to be if pass, then 'Y", if fail then "N" else blank.
Because, some of the data does not meet that. Make sense?
 
Status: IIf([results] LIKE "*pass*", "Y", IIf([results] LIKE "*fail*", "N", Null))

or

Status: Switch([results] LIKE "*pass*", "Y", [results] LIKE "*fail*", "N", True, Null)
 
I have another condition I would like to check for...
Status: IIf([Mresults] Like "*meets*","Pass",IIf([Mresults] Like "*fail*","Fail",Null)) (this is what I'm currently using and working)

IIf([Mlink] Is Null,"No") (I would like to add this to the above)

So that it would check for this too. Can't seem to get to work.

Thanks...
 
Ok, how would I combine my two statements then?
 
Yes, to replace the status. I guess it would be first. If Mlink is null, then status is null. Then the rest of the code wouldn't matter.
So, yes first.
 
How would I combine this?

Report: IIf([Msamplenumber1] Like "*H*","In Process",[Mreportid]) (this works perfect. Want to add the below to the this)

or IIf([Msamplenumber2] Like "*H*"
or IIf([Msamplenumber3] Like "*H*"
or IIf([Msamplenumber4] Like "*H*"
 

Users who are viewing this thread

Back
Top Bottom