locked
Not returning results if "NULL" is checked in a date parameter value RRS feed

  • Question

  • I am new in SSRS reporting, I am having issue when I pass null value as default parameter and expression  not return any result.

    expression =Duedate

    operator =

    value  =  Parameters!criteriaString.Value

    But when I use expression 

    expression =Duedate

    operator <=

    value    = IIF(String.IsNullOrEmpty(Parameters!criteriaString.Value) ,CDate(Format(CDate(Globals!ExecutionTime),"MM-dd-yyyy")),Parameters!criteriaString.Value)


    on null it return all record  but it doesn't  work on equal date , it return all less then date data but i want exact date data.

    any help is very much appreciated! 


     

    Friday, January 19, 2018 11:46 PM

All replies

  • Hi SJkaur,

    value = IIf(String.IsNullOrEmpty(Parameters!criteriaString.Value), CDate(Format(CDate(Globals!ExecutionTime), "MM-dd-yyyy")), Parameters!criteriaString.Value)

    According to your code above, if the Parameters!criteriaString.Value is null or empty, value=CDate(Format(CDate(Globals!ExecutionTime), "MM-dd-yyyy")), else value =Parameters!criteriaString.Value.

    You said that "on null it return all record  but it doesn't  work on equal date , it return all less then date data but i want exact date data."  I don't understand about it.

    Best Regrads,

    Cherry


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, January 22, 2018 5:53 AM

  • if date is null it returned 

    Fiscal Year 2009
                             reportyr   invoice   due date    amt
    Monaco   21369  2008      0050      08/06/2009   $2777.23

    Fiscal Year 2013
    Technol,  90451  2012    0092       08/02/2013   $1297.31

    Fiscal Year 2014

    Century 32275 2013     0156      08/14/2014        $1537.65


    when i selected date 08/02/2013

    it returned

    Fiscal Year 2009
                           reportyr   invoice   due date    amt
    Monaco   21369  2008      0050      08/06/2009   $2777.23

    Fiscal Year 2013
    Technol,  90451  2012    0092       08/02/2013   $1297.31

    But i want if i select date 08/02/2013

    it should return only

    Fiscal Year 2013
    Technol,  90451  2012    0092       08/02/2013   $1297.31

    I used (value=CDate(Format(CDate(Globals!ExecutionTime), "MM-dd-yyyy")), else value =Parameters!criteriaString.Value.) it returned error Value of type can not be converted to Boolean.


    • Edited by SJkaur Monday, January 22, 2018 4:54 PM
    Monday, January 22, 2018 4:47 PM
  • Your code is simply not VB 

    It is a kind of special SQL Server report language. 

    This is the special forum for it.

    https://social.msdn.microsoft.com/Forums/sqlserver/en-US/home?forum=sqlreportingservices


    Success Cor

    Monday, January 22, 2018 5:07 PM
  • Thank you very much Cor for letting me know.
    Monday, January 22, 2018 5:39 PM