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)
 Using a Case statement in a Where clause

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2001-10-25 : 21:39:35
Lisa writes "I want to do the following but keep getting an error.
Table : TD
Fields: ClientName Char(50)
ClientActive Bit

Create Procedure spnGetActiveClients
@Active int
as
Select Td.ClientName from TD
Where
Case @Active
When 0 Then TD.ClientActiveInd = 0 --Inactive clients only
When 1 Then TD.ClientActiveInd = 1 --Active clients only
--Else all clients both active and inactive
END
GO"
   

- Advertisement -