SSRS null data parameter in filter

I wanted to filter a date in my Tablix to be greater or equal to than the parameter date.  The only thing was, the parameter may be null.  I tried to think ahead to handle this case, and use the ISNOTHING() function to insert an early date.

Eventually I found that SSRS is able to handle this for the greater or equal to case.  When the date parameter is NULL, it simply accepts all records.  So inside of SSRS, NULL must be represented as a very early date.

NullDateParameter2

NullDateParameter

 

However, this didn’t work for the upper range.  When the upper date parameter range was NULL, it returned no records.  So this upper date needs to be handled in the filter.

 

For the expression I used:

=IIF(
ISNOTHING( Parameters!ActionEndDate.Value ),
CDATE(“2099-1-1”),
Parameters!ActionEndDate.Value
)

NullDateParameter3

Advertisements
This entry was posted in Business Intelligence and tagged . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s