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.
Author |
Topic |
1fred
Posting Yak Master
158 Posts |
Posted - 2010-04-01 : 16:35:46
|
Lets say my report receive 3 parameters.FromDateToDateFromWebPageThe report can be call from a webpage with selected parameters based on a graphic a user did build or can be opened manually from the /reports root.the FromWebPage parameter is use to identify the provenance of the user. If the user is coming from the webpage and has not chosen any dates to filter on, we want to allow the NULL values, but if the user is coming directly from the /reports page, we do want to default the dates value to an interval of 7 days maximum in order to maximize the report speed to show up.My first idea was to put a default value to the fromWebPage parameter to 0. The default value for the start date and end date would be a formula like=IIF(fromWebpage = 0, dateadd("dd",-7,NOW),FromDate)=IIF(fromWebpage = 0, NOW,toDate)I know the syntax above is wrong but its simply to show the logic behind what I'd like to do. But this way it does not work. Is there a way to do it in SSRS? |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2010-04-02 : 02:59:59
|
try something like=IIF(fromWebpage = 0, dateadd("dd",-7,NOW),Nothing)=IIF(fromWebpage = 0, NOW,Nothing)------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
|
|
1fred
Posting Yak Master
158 Posts |
Posted - 2010-04-06 : 10:00:15
|
I get a message "error during processing of Fromdate" |
|
|
|
|
|
|
|