September 10, 2011 at 11:03 am
I want to drop results from a column
ex:
...where
pi.pay_id = lpa.pay_id and
pi.business_date between '2011-08-14 00:00:00.000' and '2011-08-20 00:00:00.000'
and lpa.name != 'Sched Vac%'
and lpa.name != 'BPay%'
and lpa.name != 'Vacances%'
and lpa.name != 'Jour de reconnaissance de service'
and lpa.name != 'Funérailles%'
and lpa.name != 'Accident de travail%'
and lpa.name != 'Mobile%'
and lpa.name != 'Salaire rétroactif%'
and lpa.name != 'Jour férié%'
and lpa.name != 'Maladie%'...
But lpa.name != doesn't seem to work for me.
What am I doing wrong?
Thanks,
Jess.
September 10, 2011 at 1:21 pm
jess. (9/10/2011)
I want to drop results from a columnex:
...where
pi.pay_id = lpa.pay_id and
pi.business_date between '2011-08-14 00:00:00.000' and '2011-08-20 00:00:00.000'
and lpa.name != 'Sched Vac%'
and lpa.name != 'BPay%'
and lpa.name != 'Vacances%'
and lpa.name != 'Jour de reconnaissance de service'
and lpa.name != 'Funérailles%'
and lpa.name != 'Accident de travail%'
and lpa.name != 'Mobile%'
and lpa.name != 'Salaire rétroactif%'
and lpa.name != 'Jour férié%'
and lpa.name != 'Maladie%'...
But lpa.name != doesn't seem to work for me.
What am I doing wrong?
Thanks,
Jess.
lpa.name not like 'Sched Vac%'
September 10, 2011 at 1:32 pm
Comparison operators can be used on all expressions except expressions of the text, ntext, or image data types.
Is the column lpa.name defind as a text or ntext data type?
September 21, 2011 at 6:31 am
Not sure but if you are filtering the records using pattern matching use Not Like instead of !=.
September 21, 2011 at 6:37 am
Should use Not Like for string searches!
September 21, 2011 at 6:39 am
I actually did try that and it worked.
My issue was that I was using != '%job%'. It didn't like that I was using % in correlation with !=. I did in fact switch it to not like and it worked.
Thanks for the help!
Jess.
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply