dropping from a column

  • 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.

  • jess. (9/10/2011)


    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.

    lpa.name not like 'Sched Vac%'



    Pradeep Singh

  • 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?

    If everything seems to be going well, you have obviously overlooked something.

    Ron

    Please help us, help you -before posting a question please read[/url]
    Before posting a performance problem please read[/url]

  • Not sure but if you are filtering the records using pattern matching use Not Like instead of !=.

  • Should use Not Like for string searches!

  • 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