Quantcast
Channel: SQL Server Reporting Services, Power View 포럼
Viewing all articles
Browse latest Browse all 24955

Optional Date Parameter with Null

$
0
0

Hello.

I am using Reporting Services, Server 2008 r2.

I have queried instructions on this forum on how to have an optional date parameter with a null and everything I have tried still does not work.  I want the user to be able to plug in a begin date and end date and pull the records back between those two values.  However, if they leave the begin date and end date null, I want the report to bring back all records.

I have tried checking the Allow Null value on the parameter.  I have put an expression in the Tablix filter for begin date >= IIf(param!begindate.value = " ", "1/1/1900", param!begindate.value) and end date <= IIf(param!enddate.value = " ", "1/1/1900", param!enddate.value).  I have also put in my query in the where statement that

(field.date = @begindate or @begindate is null)

and (field.date = @enddate or @endate is null).

I have tried different combinations of these statements, however, I do not get any records back.  If I take out these parameters on the report, the report works fine.

I am frustrated with this and really could use some help.  Thank you very much.


Viewing all articles
Browse latest Browse all 24955

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>