Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8986353
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T21:31:46+00:00 2026-06-15T21:31:46+00:00

I have table tblEmployee with columns id, name, status Now I have to filter

  • 0

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

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T21:31:47+00:00Added an answer on June 15, 2026 at 9:31 pm

    Here you go:

    IF (@Mode='ViewActive') 
    BEGIN
    SELECT * FROM [tblEmployee] WHERE Status in (1, 2 )
    END
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have table with following details Table name EMPLOYEE and columns EMPID (PK smallint
I have Table Students with columns Student ID and Student Name. I also have
I have table with name users and a column in it named source .
I have a hierarchical (tree structure) SQL Server table TEmployee with following columns Id
I have my code working, but I'm getting 2 extra columns in the table/ddl,
I have table Cars Id nvarchar(25) PK Name nvarchar(max) And there is some records.
I have table named Table X which contains some names and their corresponding age,
I have table with a name filed which is string. I need to create
Thank you for looking at my issue. Right now I have 3 tables: tblEmployee
i have table student,fields are student_id, student_name, year_joining ... now i want to rename

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.