Link to home
Start Free TrialLog in
Avatar of Michael Franz
Michael Franz

asked on

SQP Operators Like, IN, Contains.....

Hello,

I am working on the following code. I am having problems with the WHERE clause...This part....

WHERE [CDE Book of Business].[Policy Exec] Like (<<[Text]+>>)

Is there a operator like CONTAINS... Where it is only part of the text to look at??

Think of it like searching a customer list where the business name contains the word BAR OR Restaurant. But I do not want it hard coded. The program I use recognizes the << >> as a prompt and fills in the rest.





SELECT DISTINCTROW [CDE Book of Business].[Policy Exec], [CDE Book of Business].[Account Name], Sum([CDE Book of Business].[Total Cost]) 

AS [Sum Of Total Cost], Sum([CDE Book of Business].[Agency Commission]) AS [Sum Of Agency Commission]


FROM [CDE Book of Business]

WHERE [CDE Book of Business].[Policy Exec] Like (<<[Text]+>>)

AND

([CDE Book of Business].[Policy Status] Is Null 

OR 

[CDE Book of Business].[Policy Status] in ('Renewed', 'Rewritten' ,'Active'))



GROUP BY [CDE Book of Business].[Policy Exec], [CDE Book of Bu

Open in new window

SELECT DISTINCTROW [CDE Book of Business].[Policy Exec], [CDE Book of Business].[Account Name], Sum([CDE Book of Business].[Total Cost]) 

AS [Sum Of Total Cost], Sum([CDE Book of Business].[Agency Commission]) AS [Sum Of Agency Commission]


FROM [CDE Book of Business]

WHERE [CDE Book of Business].[Policy Exec] Like (<<[Text]+>>)

AND

([CDE Book of Business].[Policy Status] Is Null 

OR 

[CDE Book of Business].[Policy Status] in ('Renewed', 'Rewritten' ,'Active'))



GROUP BY [CDE Book of Business].[Policy Exec], [CDE Book of Bu

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Helen Feddema
Helen Feddema
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Michael Franz
Michael Franz

ASKER

I am using Informer by Entrinsik.
Does it support the InStr function?
Any SQL funtions
thank you