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 2005 Forums
 Analysis Server and Reporting Services (2005)
 Default value for Reprt Parameter

Author  Topic 

yosiasz
Master Smack Fu Yak Hacker

1635 Posts

Posted - 2009-10-13 : 15:39:02
Greetings!

I have a report parameter (Fiscal Year) as Integer. It is populated from a query
SELECT DATEPART(yyyy, [Date]) as FiscalYear
FROM [dbo].[xyz]

I want to give this report parm a default value of current year. When using =Year(Now) the field is blanked out. How do I set a default integer value for this report parameter.
Any help would be much appreciated!

<><><><><><><><><><><><><><><><><><><><><><><><><>
If you don't have the passion to help people, you have no passion

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2009-10-13 : 16:34:56
=Year(Now())


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

yosiasz
Master Smack Fu Yak Hacker

1635 Posts

Posted - 2009-10-13 : 17:10:11
:( thanks webfred! But the field comes back as blank. What could be the problem?

Time for lunch

<><><><><><><><><><><><><><><><><><><><><><><><><>
If you don't have the passion to help people, you have no passion
Go to Top of Page

JCirocco
Constraint Violating Yak Guru

392 Posts

Posted - 2009-10-14 : 08:24:59
Within Report Parameters, I set Parameter Data Type as Integer, Available values is NOT configured. Default is Non-Queried with Webfred's value of =Year(Now())

And it displays properly. I am assuming you set it up as Available Values instead of Default.

John
Go to Top of Page

yosiasz
Master Smack Fu Yak Hacker

1635 Posts

Posted - 2009-10-14 : 11:53:14
Thanks for the tip there.
aha so that is my problem. I do have available values from a query. But I want the drop down to default to current year. Maybe you can't do that.

<><><><><><><><><><><><><><><><><><><><><><><><><>
If you don't have the passion to help people, you have no passion
Go to Top of Page
   

- Advertisement -