Solved

SSRS Expression

Posted on 2013-11-21
2
354 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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

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 …
A recent question popped up and the discussion heated up regarding updating a COMMENTS (TXT) field in a table using SSRS. http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/MS-SQL_Reporting/Q_27475269.html?cid=1572#a37227028 (htt…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

747 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now