Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 not like '%--00%'

Author  Topic 

ConradK
Posting Yak Master

140 Posts

Posted - 2009-12-16 : 15:13:52
when I put "not like '%--00%'" its seeing the -- as comment marker or soemthing, but I need to not include entries that have a '--00' in them.... what do?

vijayisonly
Master Smack Fu Yak Hacker

1836 Posts

Posted - 2009-12-16 : 15:25:19
Can you show us your whole query...this works fine for me..

declare @t table(col1 varchar(20))
insert @t
select '00--00' union all
select '100-0' union all
select '00-test--00'

select * from @t where col1 not like '%--00%'
Go to Top of Page

ConradK
Posting Yak Master

140 Posts

Posted - 2009-12-16 : 15:41:32
no, its because its a special character.

I figured it out. I needed []s.

not like '%[--]00%' is the solution. JUST figured it out.
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2009-12-17 : 02:00:41
quote:
Originally posted by ConradK

when I put "not like '%--00%'" its seeing the -- as comment marker or soemthing, but I need to not include entries that have a '--00' in them.... what do?


It is because you are using the code in the front end?

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -