Criteria in query not working (1 Viewer)

TB11

Member
Local time
Today, 01:29
Joined
Jul 7, 2020
Messages
78
Hi.

I have a query that I am using to doublecheck and then correct data entry
ID
IsActual --from table, 0 for no and 1 for yes
ActualA --from table
ActualB --from table
ActualC --from table
exp_Actual: IIf([ActualA]>0 Or [ActualB]>0 Or [ActualC]>0,"yes","no") --this is used as part 1 of the doublecheck. The ActualA,
ActualB and Actual C fields may or may not have data in them - if that makes a difference).
ToFix: IIf([IsActual]=1 And [exp_Actual]="yes","ok","FIX")

All work great - retrieves expected results. ToFix expression returns yes or ok or fix, as appropriate. There are no blanks in query results.

Issue: When I try to limit the query resutls to "FIX", by putting "FIX" in the criteria for the ToFix field, I get "Enter Parameter Value" for exp_Actual. I've rebuilt the query from scratch too, with same issue.

What am I missing?. I've used this same kind of criteria in other queries with no problems.

Thanks.
 

Minty

AWF VIP
Local time
Today, 06:29
Joined
Jul 26, 2013
Messages
10,355
Simple answer save your query, then query that.

More complicated answer. Because exp_Actual is an aliased calculated field I suspect the where clause can't find it/doesn't understand how to evaluate it..
You would have to put your IIf() expression into the criteria instead of the Alias reference.
 

Gasman

Enthusiastic Amateur
Local time
Today, 06:29
Joined
Sep 21, 2011
Messages
14,048
Try
Code:
ToFix: IIf(([IsActual]=1 And [exp_Actual]="yes"),"ok","FIX")
or perhaps
Code:
ToFix: IIf([IsActual]=1 And [exp_Actual]='yes',"ok","FIX")
 

TB11

Member
Local time
Today, 01:29
Joined
Jul 7, 2020
Messages
78
Thank you both. I needed an update query anyway, so the 2 query approach works.
 

Users who are viewing this thread

Top Bottom