| Author |
Topic  |
|
|
Sonu619
Posting Yak Master
195 Posts |
Posted - 10/01/2012 : 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 appear 06/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
India
47189 Posts |
Posted - 10/01/2012 : 12:26:44
|
do you've a calendar table in your database where you store your start end dates for fiscal years?
------------------------------------------------------------------------------------------------------ SQL Server MVP http://visakhm.blogspot.com/
|
 |
|
|
Sonu619
Posting Yak Master
195 Posts |
Posted - 10/01/2012 : 12:28:56
|
| No. |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
India
47189 Posts |
Posted - 10/01/2012 : 12:32:45
|
So is the logic always start of last fiscal year till current day?
------------------------------------------------------------------------------------------------------ SQL Server MVP http://visakhm.blogspot.com/
|
 |
|
|
Sonu619
Posting Yak Master
195 Posts |
Posted - 10/01/2012 : 12:38:08
|
Sorry My Mistake it should be
06/01/2011 To 06/30/2012 (If i run a report in 2012 06/01/2012 To 06/30/2013 (If i run a report in 2013)
Thank You. |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
India
47189 Posts |
Posted - 10/01/2012 : 12:56:17
|
see an example below
DECLARE @year int
SET @Year=2012
SELECT DATEADD(mm,5,DATEADD(yy,@year-1901,0)),DATEADD(mm,6,DATEADD(yy,@year-1900,-1))
------------------------------------------------------------------------------------------------------ SQL Server MVP http://visakhm.blogspot.com/
|
 |
|
|
Sonu619
Posting Yak Master
195 Posts |
Posted - 10/02/2012 : 13:31:24
|
Awesome Thank You for your help. I made little change.
DECLARE @year int
SET @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
India
47189 Posts |
Posted - 10/02/2012 : 14:57:40
|
welcome
------------------------------------------------------------------------------------------------------ SQL Server MVP http://visakhm.blogspot.com/
|
 |
|
| |
Topic  |
|