I have table tblEmployee with columns id, name, status
Now I have to filter users by their status, where 0 stands for inactive users, 1 for active users, 2 for new users
Condition 1: I created a stored procedure like this:
IF (@Mode = 'ViewActive')
BEGIN
SELECT *
FROM [tblEmployee]
WHERE Status = 1
ORDER BY DepartmentId, DOJ
END
This is to view active users
Condition 2:
Same way I want to create condition for active users & new users to display both at same time
I have tried
IF (@Mode='ViewActive')
BEGIN
SELECT *
FROM [tblEmployee]
WHERE Status = 1, 2
END
which shows an error.
Please help me to define second condition.. any new methods will be also helpful for me
Here you go: