SSRS, USING NULL PARMS ON THE REPORT HEADER/TITLE

I am using the available begin date and enddate parms to populate the report title that shows  "ABC DATA FROM MM/DD/YY  TO   MM/YY/DD" on the header. Here is the code I am using:
" Data from "&Parameters!BeginDate.Value &" to "& Parameters!EndDate.Value " . It works fine when "optional" From and To Dates are filled in. When using null  then my report title looks like " ABC DATA  FROM   TO  " . Is there a way for me to change the code so when NULL dates are passed it should not print " FROM  TO" ?
Abdul KhanAsked:
Who is Participating?
 
Arifhusen AnsariBusiness Intelligence Developer and AnalystCommented:
use below expression it will take care of all the possibilities.


="ABC DATA " & IIF( ISNOTHING(Parameters!BeginDate.Value),"From Begining","From "& FORMAT(Parameters!BeginDate.Value,"MM/dd/yyyy"))
&  IIF( ISNOTHING(Parameters!EndDate.Value)," Till Today"," To "& FORMAT(Parameters!EndDate.Value,"MM/dd/yyyy"))

Open in new window

0
 
Abdul KhanAuthor Commented:
Thanks so much for sharing the expression, I will always use this one.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.