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
 COLEASE

Author  Topic 

aoriju
Posting Yak Master

156 Posts

Posted - 2010-06-22 : 09:46:32
Dear all,

With using COLEASE function i want to serch .

If null then display all values other wise contains value
( character contains in a word)




Regards
Riju A.O

vijayisonly
Master Smack Fu Yak Hacker

1836 Posts

Posted - 2010-06-22 : 09:47:27
Can you pls explain what this means?
quote:
If null then display all values other wise contains value

Maybe some sample data and expected output?
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-06-22 : 10:43:15
seems like
(Field LIKE '%' + @CharVal + '%' OR @CharVal IS NULL)

is what you want

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

Sachin.Nand

2937 Posts

Posted - 2010-06-22 : 10:53:21
OP wants it using coalesce function.Maybe this


where coalesce(@param,Field)like '%' + Field + '%'




Limitations live only in our minds. But if we use our imaginations, our possibilities become limitless.

PBUH
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-06-22 : 10:57:21
quote:
Originally posted by Idera

OP wants it using coalesce function.Maybe this


where coalesce(@param,Field)like '%' + Field + '%'




Limitations live only in our minds. But if we use our imaginations, our possibilities become limitless.

PBUH


i think what op asked for is return values that have passed char embedded in it so it might be other way around

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -