Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

combine "in" and "like"

Status
Not open for further replies.

BHScripter

Technical User
Aug 26, 2002
159
US
Hi:

I'm trying to narrow down my search criteria for a set of completed learning activities by two possible words in a course name.

I tried to do the following in the where clause and it didn't work:

where a.activity in like('%Sales%', '%Service%')

I can't use an "or" as there are other conditions which are included in the where clause that must be met. Is there a way to use like in an "in" statement?

Thanks for any help
 


hi,
I can't use an "or" as there are other conditions
Why not
Code:
Where....
  AND (a.activity like '%Sales%' OR a.activity like '%Service%')


Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
No, there is no ability to use IN and like.

You can use parenthesis, though, e.g.

where (a.Activity like '%Sales%' or a.Activity like '%Service%') and A.SomeOtherField = 5
 
DUH! Thanks so much it should have reached out and smacked me.

:)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top