Multiple condition IIF

SalesOpsSolutions

New member
Local time
Today, 13:21
Joined
Nov 13, 2007
Messages
2
I can't get this expression in Query to work! Any suggestions?

Account Type: IIf([parent account name] like “*hosp*”,"Hosp",IIf([parent account name] like "*vet*”,"Vet",IIf([parent account name] like “*dds*”,"DENT”,IIf([parent account name] like "*dmd*”,"Dentist”,IIf([parent account name] like "*pharm*”,"Pharm”,0)))))

as you can see I am doing search and identify for a new field.

I get an error message "the expression you entered contains invalid syntax"
 
i use these all the time, did you try running each iif statement indepently? the main issue with running this in a query is that the error messages are not too descriptive. there could be many issues with this statement. try to run each iif statement indepentely and make sure you copy paste so that there are no typos.

good luck,

sam
 
The problem is that you are using strange characters that look like double quotes but aren't. Try this: exactly the same but replacing the odd characters (i.e., “ & ” )with proper quotes (" & ").


Account Type:IIf([parent account name] Like "*hosp*","Hosp",IIf([parent account name] Like "*vet*","Vet",IIf([parent account name] Like "*dds*","DENT",IIf([parent account name] Like "*dmd*","Dentist",IIf([parent account name] Like "*pharm*","Pharm",0)))))
 
What can I say, it's the appreciative biologist in me acting up :D
 
Hello All!
I have never run into a character set issue for query - just using regular old keyboard " " quotes...

Appreciate all of teh groups comments!
 

Users who are viewing this thread

Back
Top Bottom