Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Parameter for Picking from Two Different Types of Date Ranges


Parameter for Picking from Two Different Types of Date Ranges

Author
Message
service 87594
service 87594
Grasshopper
Grasshopper (15 reputation)Grasshopper (15 reputation)Grasshopper (15 reputation)Grasshopper (15 reputation)Grasshopper (15 reputation)Grasshopper (15 reputation)Grasshopper (15 reputation)Grasshopper (15 reputation)

Group: General Forum Members
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.

JNM
mikehunsaker
mikehunsaker
SSC Rookie
SSC Rookie (26 reputation)SSC Rookie (26 reputation)SSC Rookie (26 reputation)SSC Rookie (26 reputation)SSC Rookie (26 reputation)SSC Rookie (26 reputation)SSC Rookie (26 reputation)SSC Rookie (26 reputation)

Group: General Forum Members
Points: 26 Visits: 180
Could you use the ISNULL function like:


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


Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search