The date parameter allows for a date to be input by a report consumer in a text box or using a calendar control.  In the following example two parameters have been added called "Start Date" and "End Date".



In addition to the to the common attributes available to all parameter types the following additional attributes are available:


  • Is Value Required
    • Defines whether a user must enter a field value before executing the report. Click here to read more about the "Is Value Required" attribute.
  • Value
    • Assigns a default value to the field
  • Publish Updates
    • Will force parameter controls to reload when the date is updated
  • Use Current Date
    • Assigns a default value to the control based on the current date in which the report is being executed
  • Current Date Offset
    • A positive or negative number that represents the numbers of days in which to offset from the current date.  In the above example, the default value for the control will be set to the current date minus 30 days 


 

Usage in SQL Command Text

A single variable will be declared as a DATE in the auto-generated section and can be used as a standard SQL variable.  In the below example two date parameters with programmatic names of "StateDate" and "EndDate" have been added to the report and is utilized within the SQL expression.




The generated SQL when executing a report containing a number parameter type is shown below: