Reputation: 121
I'm trying to say if the event has '%webinar%','%network%' in the name include it "if" the date is after the 01-04-2015. I cant use "or" on a separate line as it ignores the date. Any help appreciated.
select
,fsa.eventid
,sev.EventStart
from
event sev
on
sev.eventId = fsa.eventid
where sev.SNAP_EventStart >= '2015-04-01'
and eventidname in ('%webinar%','%network%')
Upvotes: 0
Views: 103
Reputation: 28
Try this.
select
,fsa.eventid
,sev.EventStart
from
event sev
on
sev.eventId = fsa.eventid
where sev.SNAP_EventStart >= '2015-04-01'
and
(
Patindex('%webinar%', eventidname) = 1
OR Patindex('%network%', eventidname) = 1
)
Upvotes: -1
Reputation: 4844
Try this way
SELECT *
FROM table t INNER JOIN
(
SELECT '%webinar%' Col
UNION SELECT '%network%' col
) a ON t.COLUMN LIKE a.Col
Upvotes: 0
Reputation: 691
please try
... where sev.SNAP_EventStart >= '2015-04-01'
and (eventidname like '%webinar%' or eventidname like '%network%')
Upvotes: 2