Groups | Blog | Home
all groups > sql server reporting services > august 2005 >

sql server reporting services : Generating parameters from a list


Wayne Snyder
8/15/2005 12:00:00 AM
This query will do it... Setup your parameter and set this query to be the
default value

select datename(yyyy,getdate())
+',' + datename(yyyy,dateadd(yy,-1,getdate()))
+',' + datename(yyyy,dateadd(yy,-2,getdate()))
+',' + datename(yyyy,dateadd(yy,-3,getdate()))
+',' + datename(yyyy,dateadd(yy,-4,getdate()))

--
Wayne Snyder MCDBA, SQL Server MVP
Mariner, Charlotte, NC
(Please respond only to the newsgroup.)

I support the Professional Association for SQL Server ( PASS) and it's
community of SQL Professionals.
[quoted text, click to view]

Sarah
8/15/2005 10:41:03 AM
I have a number of fiscal reports that I am writing. Currently, the
parameter for year is hard-coded. Ideally, I would like to be able to
generate the parameter list so that it offers years in descending from the
current year back 5 years or some defined period. In this manner, the
reports would not need to be updated each new year to modify the parameter
daw
8/15/2005 10:48:05 AM
One solution could be to create a dataset that pulls the year of a date field
in your report (group on the year) and use that as your query for the
parameter.

[quoted text, click to view]
AddThis Social Bookmark Button