If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
iif statement in query
Hello,
I'm trying to use an "OR" in this iif statement and it's not working. Can somebody please help? My goal is: if ProductResultBDHC contains C or P, then make it = 10. If there is no C or P, then it will = 5. LeadTime: IIf([ProductResultBDHC] Like "*C*" or IIf([ProductResultBDHC] Like "*P*",10,5)) Thanks for your help, Joel |
#2
|
|||
|
|||
iif statement in query
Remove the second IIf:
IIf([ProductResultBDHC] Like "*C* or [ProductResultBDHC] Like "*P*", 10, 5) Carl Rapson "Joel Allen" wrote in message ... Hello, I'm trying to use an "OR" in this iif statement and it's not working. Can somebody please help? My goal is: if ProductResultBDHC contains C or P, then make it = 10. If there is no C or P, then it will = 5. LeadTime: IIf([ProductResultBDHC] Like "*C*" or IIf([ProductResultBDHC] Like "*P*",10,5)) Thanks for your help, Joel |
#3
|
|||
|
|||
iif statement in query
Not sure - might try taking out the second IIf statement and see if it works.
-- Thanks, Jason "Joel Allen" wrote: Hello, I'm trying to use an "OR" in this iif statement and it's not working. Can somebody please help? My goal is: if ProductResultBDHC contains C or P, then make it = 10. If there is no C or P, then it will = 5. LeadTime: IIf([ProductResultBDHC] Like "*C*" or IIf([ProductResultBDHC] Like "*P*",10,5)) Thanks for your help, Joel |
#4
|
|||
|
|||
iif statement in query
On Thu, 22 Feb 2007 09:34:53 -0800, Joel Allen wrote:
Hello, I'm trying to use an "OR" in this iif statement and it's not working. Can somebody please help? My goal is: if ProductResultBDHC contains C or P, then make it = 10. If there is no C or P, then it will = 5. LeadTime: IIf([ProductResultBDHC] Like "*C*" or IIf([ProductResultBDHC] Like "*P*",10,5)) Thanks for your help, Joel Too many IIF's. The letters C or P can be anywhere in the field? LeadTime: IIf([ProductResultBDHC] Like "*C*" or [ProductResultBDHC] Like "*P*",10,5) -- Fred Please respond only to this newsgroup. I do not reply to personal e-mail |
#5
|
|||
|
|||
iif statement in query
On Thu, 22 Feb 2007 09:50:22 -0800, fredg
wrote: The letters C or P can be anywhere in the field? LeadTime: IIf([ProductResultBDHC] Like "*C*" or [ProductResultBDHC] Like "*P*",10,5) or: IIF([ProductResultBDHC] Like "*[CP]*",10,5) Putting a charlist in brackets will match any one of the characters. John W. Vinson [MVP] |
Thread Tools | |
Display Modes | |
|
|