I am getting stuck on some SQL with a CASE condition.
Its a back end for a SSRS 2005 report and the user can select ALL, < 50k, or > 50K
The guts are..
SELECT LOANAMOUNT
FROM LOANS
WHERE loanAmount (CASE WHEN @Parameter 'All' THEN = loanAmount --Ignore the variable
ELSE @parameter = 1 THEN <= 50k
ELSE @parameter = 2 THEN > 50K
END CASE)
The issue I am having is the >< signs. I can factor in the = but I can't tell it to get ALL then change my operators in the case.
Any insights would be great. Thanks
All=Select All Records
or depends upon
@Parameter
values will be filtered