Thursday, March 29, 2012

equal sign

I need to search for the equal sign in field data. Have not been able to
figure it out. Does anyone know how to do this?
fieldname like '%=%'
Thanks for any help you can give!!The following works fine for me. Does it not, for you?
create table #x (blat varchar(50))
insert #x
select 'abc=def'
union all
select 'abc'
union all
select 'def'
union all
select '='
select *
from #x
where blat like '%=%'
--
Adam Machanic
SQL Server MVP - http://sqlblog.com
Author, "Expert SQL Server 2005 Development"
http://www.apress.com/book/bookDisplay.html?bID=10220
"Rick" <rick@.di-wave.com> wrote in message
news:OWPoYnp2HHA.728@.TK2MSFTNGP05.phx.gbl...
>I need to search for the equal sign in field data. Have not been able to
>figure it out. Does anyone know how to do this?
> fieldname like '%=%'
> Thanks for any help you can give!!
>|||Hmmm No it does not work for me. I will make sure I have not missed typed
something.
Thanks!!
"Adam Machanic" <amachanic@.IHATESPAMgmail.com> wrote in message
news:eijhwsp2HHA.6072@.TK2MSFTNGP03.phx.gbl...
> The following works fine for me. Does it not, for you?
>
> --
> create table #x (blat varchar(50))
> insert #x
> select 'abc=def'
> union all
> select 'abc'
> union all
> select 'def'
> union all
> select '='
> select *
> from #x
> where blat like '%=%'
> --
>
> --
> Adam Machanic
> SQL Server MVP - http://sqlblog.com
> Author, "Expert SQL Server 2005 Development"
> http://www.apress.com/book/bookDisplay.html?bID=10220
>
> "Rick" <rick@.di-wave.com> wrote in message
> news:OWPoYnp2HHA.728@.TK2MSFTNGP05.phx.gbl...
>>I need to search for the equal sign in field data. Have not been able to
>>figure it out. Does anyone know how to do this?
>> fieldname like '%=%'
>> Thanks for any help you can give!!
>|||If you copy and paste the example I posted, and run it, what is the output?
Adam Machanic
SQL Server MVP - http://sqlblog.com
Author, "Expert SQL Server 2005 Development"
http://www.apress.com/book/bookDisplay.html?bID=10220
"Rick" <rick@.di-wave.com> wrote in message
news:e$wMiyp2HHA.5740@.TK2MSFTNGP04.phx.gbl...
> Hmmm No it does not work for me. I will make sure I have not missed typed
> something.
> Thanks!!
>
> "Adam Machanic" <amachanic@.IHATESPAMgmail.com> wrote in message
> news:eijhwsp2HHA.6072@.TK2MSFTNGP03.phx.gbl...
>> The following works fine for me. Does it not, for you?
>>
>> --
>> create table #x (blat varchar(50))
>> insert #x
>> select 'abc=def'
>> union all
>> select 'abc'
>> union all
>> select 'def'
>> union all
>> select '='
>> select *
>> from #x
>> where blat like '%=%'
>> --
>>
>> --
>> Adam Machanic
>> SQL Server MVP - http://sqlblog.com
>> Author, "Expert SQL Server 2005 Development"
>> http://www.apress.com/book/bookDisplay.html?bID=10220
>>
>> "Rick" <rick@.di-wave.com> wrote in message
>> news:OWPoYnp2HHA.728@.TK2MSFTNGP05.phx.gbl...
>>I need to search for the equal sign in field data. Have not been able to
>>figure it out. Does anyone know how to do this?
>> fieldname like '%=%'
>> Thanks for any help you can give!!
>>
>sql

No comments:

Post a Comment