1 Reply Latest reply on May 23, 2012 11:48 AM by Tracy Rodgers

    Date Range Parameter with Start Date Defaulting to Now()

    Jason Strimpel



      I would like to create a Date Range Parameter that allows the user to use a slider to select a range of dates. I need to set the start/beginning date value of the slider according to the following criteria:


      • The beginning date must be today or later (the user cannot be allowed to select a date in the past)
      • The beginning date must dynamically update based on today's date (perhaps using the Now() function (?))


      Any thoughts on this?

        • 1. Re: Date Range Parameter with Start Date Defaulting to Now()
          Tracy Rodgers

          Hi Jason,


          You can do this by first creating a float parameter (if desired, place a range of numbers, create a list or use all). Then, create a calculated field from the parameter similar to the following:


          if [Order Date]>=today() and [Order Date]<=dateadd('day', [Date Range], today()) then [Order Date]  end


          For this example, Order Date is your date field and Date Range is the parameter. Then, right click on the parameter in the data box and select Show Parameter control. This calculation will allow the user to see the number of days from whatever today is.


          Place the calculation on the filter shelf. Choose the Select from List option, click None. Then, check the Exclude box and check Null.


          Hope this helps!