Criteria for an Iif statement in a query

G

Guest

I am using an Iif statement in a query.
Reason Code: IIf([MR New Cost]<>[MR Old Cost],"D",IIf([New Cost]<>[Old
Cost],"C",IIf([New GTM %]<>[Old GTM %],"G",IIf([New Sell]<>[Old
Sell],"S","O"))))
The Iif statement works fine, but..I would like to add a criteria that would
exclude all of the O's (Is not "O"). When I add the criteria and run the
query I get an"Enter the Parameter" pop up. It apperas to be asking me to
enter a value for each of the bracketed items in the Iif statement. Hope
this explains the sitaution OK.
How can I add the criteria to filter the results of the query.
Thanks for your help.
 
G

Guest

WHERE (((([prccntln_view.price]*1)) Is Not Null) AND (Not (IIf([MR New
Cost]<>[MR Old Cost],"D",IIf([New Cost]<>[Old Cost],"C",IIf([New GTM %]<>[Old
GTM %],"G",IIf([New Sell]<>[Old Sell],"S","O")))))="O"))

KARL DEWEY said:
Post your complete SQL statement.

Jim said:
I am using an Iif statement in a query.
Reason Code: IIf([MR New Cost]<>[MR Old Cost],"D",IIf([New Cost]<>[Old
Cost],"C",IIf([New GTM %]<>[Old GTM %],"G",IIf([New Sell]<>[Old
Sell],"S","O"))))
The Iif statement works fine, but..I would like to add a criteria that would
exclude all of the O's (Is not "O"). When I add the criteria and run the
query I get an"Enter the Parameter" pop up. It apperas to be asking me to
enter a value for each of the bracketed items in the Iif statement. Hope
this explains the sitaution OK.
How can I add the criteria to filter the results of the query.
Thanks for your help.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top