SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 Analysis Server and Reporting Services (2008)
 Default Date in SSRS
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Sonu619
Posting Yak Master

195 Posts

Posted - 10/01/2012 :  12:21:58  Show Profile  Reply with Quote
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
52325 Posts

Posted - 10/01/2012 :  12:26:44  Show Profile  Reply with Quote
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

195 Posts

Posted - 10/01/2012 :  12:28:56  Show Profile  Reply with Quote
No.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52325 Posts

Posted - 10/01/2012 :  12:32:45  Show Profile  Reply with Quote
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

195 Posts

Posted - 10/01/2012 :  12:38:08  Show Profile  Reply with Quote
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

India
52325 Posts

Posted - 10/01/2012 :  12:56:17  Show Profile  Reply with Quote
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

195 Posts

Posted - 10/02/2012 :  13:31:24  Show Profile  Reply with Quote
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

India
52325 Posts

Posted - 10/02/2012 :  14:57:40  Show Profile  Reply with Quote
welcome

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

Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.12 seconds. Powered By: Snitz Forums 2000