Solved

SSRS Expression

Posted on 2013-11-21
2
358 Views
Last Modified: 2013-12-10
Hi,

I am trying to set a default parameter value in SSRS.

I have two columns in a dataset, "Year" and "MonthNo". I would like the expression to return the maximum "MonthNo" where the "Year" is equal to the maximum "Year". I do not want to do this as a separate SQL query.

Thanks, Greg
0
Comment
Question by:spen_lang
2 Comments
 
LVL 37

Accepted Solution

by:
ValentinoV earned 500 total points
ID: 39668796
"I do not want to do this as a separate SQL query."

Then you'll not like my answer but a new SQL query is your only option.  For the simple reason that expressions to set the default value of a report parameter do not allow any dataset field references, unfortunately...
0
 
LVL 65

Expert Comment

by:Jim Horn
ID: 39668809
^^^ adding to VV ^^^

It is a common practice with reports that anything resembling 'business logic' be in the database T-SQL, and not in the report file itself.
It's easier to maintain in the database should those rules change
If other reports can use it it can be made a function called multiple times (i.e. 'component').
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Time Corrections for Reports Working with a report, we made some interesting discoveries about the time corrections/updates We are using the following Parameters: Starting Entered Date (Date) formatted as Data type: "Date/Time" Ending Entered …
This code started out as a fix for a customer that had incoming data that was hunderds of numbers and words long that was to fit in one column. The problem was that the customer did not want to split words or numbers when wrapping in the column. …
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question