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.
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
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
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Does it support the InStr function?
ASKER
Any SQL funtions
ASKER
thank you
ASKER