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.

 All Forums
 Development Tools
 Reporting Services Development
 Drop Down Menu

Author  Topic 

werhardt
Constraint Violating Yak Guru

270 Posts

Posted - 2008-06-12 : 14:16:50
I am not sure if you would be able to help or understand what I am talking about since I have a hard time explaning thing, haha.

My boss wanted these 3 reports.

Weekly Claims Settlement Report
Monthly Claims Settlement Report
Yearly Claims Settlement Report

For all three reports I have formula for each of them. Now he would like to see them all in one report. What I am trying to do is have a drop down that says Weekly, Monthly, Yearly. How would I something like this? I know how to do this for a single field like WHERE (Type IN (@Type)), but I never done this with actual formulas.

Can anyone give me some advice? Here are the formulas below.

(YEAR(CLM_DOUT) = YEAR(GETDATE())) AND (DATEPART(wk, CLM_DOUT)
= DATEPART(wk, GETDATE()))

(MONTH(CLM_DOUT) = MONTH(GETDATE())) AND (YEAR(CLM_DOUT)
= YEAR(GETDATE()))

(YEAR(CLM_DOUT) = YEAR(GETDATE()))

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-06-13 : 02:59:10
Add a new parameter to you procedure and use CASE WHEN while evaluating condition

CASE WHEN @Type ='Weekly' THEN...
WHEN @Type='Monthly' THEN...
WHEN @Type='Yearly' THEN...
END
Go to Top of Page
   

- Advertisement -