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.
| Author |
Topic |
|
anishap
Yak Posting Veteran
61 Posts |
Posted - 2007-10-03 : 16:10:58
|
| Can anyone help me with the case statements?I have customized a new report for our application (vendor software). I want the end user to check 3 boxes to print (they can check all boxes or one or two).Below is the case statement I tired in the where clauseWhere STATUS = CASEWHEN REPORT.SEPARATED = 'y' THEN 'S'WHEN REPORT.TERMINATED = 'y' THEN 'T'WHEN REPORT.RETIRED ='y' THEN 'R'ENDRightnow it is working fine if any one box is checked. Please let me if there is any other way to do this.many thanks |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2007-10-03 : 16:26:39
|
| if i understood you correctly you have to split your case into 3 cases which you have to OR:where status = case1 or status = case2 or status = case3_______________________________________________Causing trouble since 1980blog: http://weblogs.sqlteam.com/mladenpSSMS Add-in that does a few things: www.ssmstoolspack.com |
 |
|
|
Kristen
Test
22859 Posts |
Posted - 2007-10-03 : 18:00:06
|
| [code]WHERE (STATUS = 'S' AND REPORT.SEPARATED = 'y') OR (STATUS = 'T' AND REPORT.TERMINATED = 'y') OR (STATUS = 'R' AND REPORT.RETIRED ='y')[/code]Kristen |
 |
|
|
anishap
Yak Posting Veteran
61 Posts |
Posted - 2007-10-04 : 17:09:53
|
| Many Thanks Kristen, it is working now. |
 |
|
|
|
|
|