Click here to monitor SSC
SQLServerCentral is supported by Redgate
Log in  ::  Register  ::  Not logged in
Home       Members    Calendar    Who's On

Add to briefcase

Parameter for Picking from Two Different Types of Date Ranges Expand / Collapse
Posted Monday, March 11, 2013 3:47 PM


Group: General Forum Members
Last Login: Monday, April 11, 2016 3:31 PM
Points: 15, Visits: 71
Hello all,

I'm trying to set two - optional parameters - one for calendar year and one for sales year. The user needs to pick dates that are either a Calendar Year or a Sales Year. The code works in the query allowing a null value for either but not both, but when run in the report, it wants paramaters for both.

Here's the dataset code:
...and (YearVal In (@CalYear) or FYearShortVal In (@SalesYear))

Parameters are both set to multivalue and allow blank value. The available values are hand entered (specify values) - for example - in the Sales Year, the first label is 09/10 and the text value is 09/10, etc. for five entries, Calendar Year is similar - 2009, 2009, etc. I tried adding a blank label and empty value (not null or 0) to each of the value lists, but that didn't work either.

What am I missing?

Thank you.

Post #1429514
Posted Wednesday, March 20, 2013 8:36 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Friday, January 17, 2014 11:31 AM
Points: 26, Visits: 180
Could you use the ISNULL function like:

...and (YearVal In (ISNULL(@CalYear, 0)) or FYearShortVal In (ISNULL(@SalesYear,0)))

Post #1433257
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse