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
 SQL Server 2008 Forums
 Analysis Server and Reporting Services (2008)
 Default Date in SSRS

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 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

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 MVP
http://visakhm.blogspot.com/

Go to Top of Page

Sonu619
Posting Yak Master

202 Posts

Posted - 2012-10-01 : 12:28:56
No.
Go to Top of Page

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 MVP
http://visakhm.blogspot.com/

Go to Top of Page

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 2012
06/01/2012 To 06/30/2013 (If i run a report in 2013)

Thank You.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-10-01 : 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/

Go to Top of Page

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 int

SET @Year=YEAR(GETDATE())

Thank You...

SELECT DATEADD(mm,5,DATEADD(yy,@year-1901,0)),DATEADD(mm,6,DATEADD(yy,@year-1900,-1))
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-10-02 : 14:57:40
welcome

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -