SELECT tranid, entity, trandate, total
FROM transaction
WHERE type = 'SalesOrd'
AND trandate BETWEEN {today}-30 AND {today}
ORDER BY trandate DESC;
Retrieves all Sales Orders (type = 'SalesOrd') created in the last 30 days.
The trandate filter ensures only transactions within the specified date range are included.
Results are sorted in descending order of trandate, with the most recent transactions listed first.