Author |
Topic |
Sonu619
Posting Yak Master
202 Posts |
Posted - 2012-10-01 : 12:21:58
|
Hi Guys, Quick question, How i can set a default date to Fiscal Year in SSRS (I.e If i run report in 2012(October) Default should appear06/01/2011 to 09/30/2012 and if run this report in 2013 (October) Default date should appear 06/01/2012 to 09/30/2013.Thank You. |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2012-10-01 : 12:26:44
|
do you've a calendar table in your database where you store your start end dates for fiscal years?------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
|
|
Sonu619
Posting Yak Master
202 Posts |
Posted - 2012-10-01 : 12:28:56
|
No. |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2012-10-01 : 12:32:45
|
So is the logic always start of last fiscal year till current day?------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
|
|
Sonu619
Posting Yak Master
202 Posts |
Posted - 2012-10-01 : 12:38:08
|
Sorry My Mistake it should be 06/01/2011 To 06/30/2012 (If i run a report in 201206/01/2012 To 06/30/2013 (If i run a report in 2013)Thank You. |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2012-10-01 : 12:56:17
|
see an example belowDECLARE @year intSET @Year=2012SELECT DATEADD(mm,5,DATEADD(yy,@year-1901,0)),DATEADD(mm,6,DATEADD(yy,@year-1900,-1)) ------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
|
|
Sonu619
Posting Yak Master
202 Posts |
Posted - 2012-10-02 : 13:31:24
|
Awesome Thank You for your help. I made little change.DECLARE @year intSET @Year=YEAR(GETDATE())Thank You...SELECT DATEADD(mm,5,DATEADD(yy,@year-1901,0)),DATEADD(mm,6,DATEADD(yy,@year-1900,-1)) |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2012-10-02 : 14:57:40
|
welcome------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
|
|
|