We just switched from MySQL to Postgres 13.6.
I am trying to return results for unpaid invoices that are between 30 and 59 days from invoice create date, so anything that has gone 30 and 59 days unpaid since being created.
In MySQL this was done as:
and datediff(current_date,date(`invoices`.`created_at`)) BETWEEN 30 AND 59;
I've tried a few different things with intervals and BETWEEN
, but nothing seems to work.