Multiple wildcards in Iif statement

Datafiend

Registered User.
Local time
Today, 18:05
Joined
Sep 11, 2009
Messages
11
Hi there
Below is a simplified version of what I'm trying to do which is to combine the two wildcard statements into one statement so that I don't have to repaeat the table and field names again. In my actual query I've got so many of these statements that I've exceeded some limit and cannot finish the query.
Is it posible to do this?

Thanks in advance for any help you can offer.

Datafiend

Code:
BusinessType: IIf([tblCompanyName]![Employer Legal Name] Like "*Ltd","Incorporated",IIf([tblCompanyName]![Employer Legal Name] Like "*Trust","Incorporated",”Not Incorporated"))
 
Unfortunately there is no faclity to use multiple comparisons like this. You could write a custom function to make the code more readable.

BTW, Multiple comparisons can be achieved but only for single characters by enclosing the set of optional characters in square brackets inside the string.

Like "*[abc]*" will return any string that includes an a, b or c.

Also you would also be well advised to store your BusinessType field as a integer and use a lookup table for the text.
 
Thanks very much for your help and advice.

;)
 

Users who are viewing this thread

Back
Top Bottom