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
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Coalesce

Author  Topic 

pattikay
Starting Member

36 Posts

Posted - 2001-09-11 : 06:00:52
Is it possibe to use COALESCE and LIKE in the same statement ?this is what i am trying to do in the where part of my sql statement :

and gp_surname = coalesce(@gp_surname,gp_surname)
and gp_code = coalesce(@gp_code,gp_code)


but the variable @gp_surname that is being passed may come in either of the following formats (as an example let a gp be called Bolton):
Bolton
Bolto
Bolt
B
or it may not be passed at all.
Any suggestions?
Thanks in advance.


   

- Advertisement -