To select records (e.g. from an errors table) created between now and a day ago, you can use the interval syntax:
select * from errors
where date_entered > (now() - (interval '1 day'))
If you'd like to select over the past 3 days, you can use a multiplier with the interval:
select * from errors
where date_entered > (now() - (3 * interval '1 day'))
Leave a comment