...
Log into your Confluence instance.
- Navigate to the required page and click .
- Insert Run with a user form and parameters macro to build the form.
- Click Edit to open the macro settings window.
- In Field settings, click +Add field to add fields to the form. Ensure to select Field type as Date for at least two fields so as to provide a date range.
- Enter the name of the button in the Run button text field. This ensures that a button with the given text is displayed on the form.
- Click Save settings and Save the page. The form is displayed as follows:
- Insert SQL Query macro inside the Run with a user form and parameters macro.
- Edit the SQL Query macro to open the settings pop-up.
- Select the required Data source profile from the drop-down.
Enter the SQL statement based on the Field key mentioned in step 5.
In the following query, theCAST
operator is used to convert the literal strings'2003-01-01'
and'2003-12-31'
toDATE
values.Code Block language sql Select * from table_name where column_name BETWEEN CAST('$date2' AS DATE) AND CAST('$date1' AS DATE);
- Click Save settings and Save the page.
- Enter the date range or select the dates based on the date format mentioned in step 5, and click Show Data on the form.
...