This can be achieved in two approaches depending on how you store your date field in the table.
Your reports, whether using a search form or a predefined criteria, can be setup in such a way that expired records are never shown or included in search results.
Depending on how the date field is setup, one of the following methods should be used to create a 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 criteria.
- If You want to include today’s records in search results, add another criteria 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 “Hidden” form element.
- Set the comparison type of your criteria to “After Now”.
- If you have a second criteria for this field, set its comparison type to “Today”.
Option 2: Expire records X days after the value of a date field.
Use this method if you do not have an expiration date, but you want to stop including records that are certain number of days old.
- In your report, add your date field to the filtering fields list.
- Add a second criteria to the date field using the “New Criteria” insert button.
- Choose “OR” as logical operator between the two criteria.
- Set Comparison type of the first criteria to “Previous X Days” and put the desired value (X).
- Set Comparison type of the second criteria to “Today”.