Hi
How to solve this
CREATE TABLE TABLERECS1
(
id int primary key identity(1,1),
Empname nvarchar(20),
Empstatus nvarchar(20),
EmpAssignID INT
)
insert into TABLERECS1 values('John','ACT',1001)
insert into TABLERECS1 values('Rob John','PEN',1001)
insert into TABLERECS1 values('Little John','CAN',1001)
insert into TABLERECS1 values('Flour John','CLO',1001)
insert into TABLERECS1 values('rich John','TER',1001)
insert into TABLERECS1 values('save John','ACP',1001)
SELECT * FROM TABLERECS1
/** I need how to create procedure following Criteria
/** 1. When i pass EmpAssignID=1001 i need show all records (all Status records. But Not Equal <>'CLO' AND 'ACP') those records only
/** 2. When pass id<>1001 I need show all reocrds ( but only Status PEN,CAN only)
//* but i need single query no need if statment
//* i think we need case statement in the Empstatus . any one guide me
Mark as Answer if its helpful to you
Kumaraspcode2009@gmail.com