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.
| Author |
Topic |
|
TheOxblood
Starting Member
19 Posts |
Posted - 2011-09-18 : 08:50:22
|
| How can I remove NULL Cells in my query because some records appears even if the CompanyName doesnt exist?SELECT ClientID, CompanyName, FirstName, LastName, Street, CityFROM ClientWHERE CompanyName LIKE '%G%' Or FirstName LIKE '%J%' Or LastName LIKE '%J%' Or Street LIKE '%J%' Or City LIKE '%J%' Or ContactNo LIKE '%0%'AND ClientTypeID = 2 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2011-09-18 : 08:57:07
|
| [code]SELECT ClientID, CompanyName, FirstName, LastName, Street, CityFROM ClientWHERE (CompanyName LIKE '%G%' Or FirstName LIKE '%J%' Or LastName LIKE '%J%' Or Street LIKE '%J%' Or City LIKE '%J%' Or ContactNo LIKE '%0%')AND ClientTypeID = 2AND CompanyName IS NOT NULL[/code]------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
TheOxblood
Starting Member
19 Posts |
Posted - 2011-09-18 : 09:06:32
|
quote: Originally posted by visakh16
SELECT ClientID, CompanyName, FirstName, LastName, Street, CityFROM ClientWHERE (CompanyName LIKE '%G%' Or FirstName LIKE '%J%' Or LastName LIKE '%J%' Or Street LIKE '%J%' Or City LIKE '%J%' Or ContactNo LIKE '%0%')AND ClientTypeID = 2AND CompanyName IS NOT NULL ------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/
Thank You Very Much! :) I use this command on my Client Search TextBoxVonn Liquiran |
 |
|
|
|
|
|
|
|