Date filter allows users to choose a single date to insert into the report's SQL.
In this example, we have set up two variables:
end_date. You can refer to these variables in your query using double curly braces:
- Default Value: Optional. If not set, this will default to 'yesterday'. The date filter accepts both specific date expressions (for example 2018-12-31) and relative date expressions (such as 'yesterday' or '2 weeks ago'). Please refer to Working With Dates page for more information.
- Help text: Optional. Description of the filter.
- Selectable Range: Explicitly define the time range that users can choose from. In Min and Max date fields you can use normal dates or relative date expressions. The value can also be derived from a SQL if you choose From Data Source option.
- Permissions: Optional. This allows you to set specific date ranges for different user groups. To learn more about permissions, please see Restricting Date Selection for Date Filters.
Please refer Working With Dates for more examples of relative date expressions.
To see how to include the date filter in your SQL query, please see Query Syntax References.