SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Administration
 sql condition checking
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

shanish
Starting Member

2 Posts

Posted - 03/15/2012 :  01:48:38  Show Profile  Reply with Quote
I have a query here,

I have a table consist of a column 'Marks'. In that marks I've to check whether it is greater than 50 or not. If it is 50 its pass else fail, for this I wrote a query as

SELECT MARKS,

CASE WHEN MARKS >= 50 THEN 'PASS'

ELSE 'FAIL'

END AS STATUS

FROM TABLENAME

here I can get the expected result, but the problem is I need to give a parameter as, if I give 0 it shold display only the fail results, and if I give 1 should show only pass, if 2, both fail and pass.........how is it possible can anyone help me

shanish
Starting Member

2 Posts

Posted - 03/15/2012 :  02:10:59  Show Profile  Reply with Quote
I've to create a report using SSRS, and the query should work in SSRS, can anyone help me
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.03 seconds. Powered By: Snitz Forums 2000