Filtering Reports Based on an Expiration Date
2 minutes to readYou can filter reports based on an expiration date in two ways depending on how you store your date field in the table.
Your reports, whether using a search form or predefined criteria, can be set up in such a way that expired records are never shown or included in search results.
Depending on how the date field is set up, one of the following methods should be used to create hidden criteria in your search or default criteria. Note that date comparisons are sensitive to the timezone setting of the localization object of your DataPage.
Option 1:
Use this method if your table includes an expiration date.
- Include the expiration date field as a search criterion.
- If you want to include today’s records in search results, add another criterion to the date field through “New Criteria” using the “Insert” button and set the logical operator between them to “OR”.
- If using a search field, set your criteria to use the “Hidden” form element.
- Set the comparison type of your criteria to “After Now”.
- If you have a second criterion for this field, set its comparison type to “Today”.
Option 2:
Use this method if you do not have an expiration date, but you want to stop including records that are a certain number of days old.
- In your report, add your date field to the filtering fields list.
- Add a second criterion to the date field using the “New Criteria” insert button.
- Choose “OR” as the logical operator between the two criteria.
- Set the comparison type of the first criteria to “Previous X Days” and put the desired value (X).
- Set the comparison type of the second criterion to “Today”.