Tip – Add simple variable value to put into the AOT query range field. I use this class quite often to enhance reporting dialogs, etc. SysQueryRangeUtil Class.
In the AOT query, add your date field to the RANGE and add the variable (dayRange(-30,0)) as the value. Simple
Trick – What this does is filter for the data values falling in the range of the last 30 days. You can also create custom methods in this class for specific table fields.