n for the right syntax to use near '= NOW() - INTERVAL 1 DAY' at line 1 code example
Example: today minus 15 days postgresql
--yesterday
SELECT NOW() - INTERVAL '1 DAY';
--Unrelated to the question, but PostgreSQL also supports some shortcuts:
SELECT 'yesterday'::TIMESTAMP, 'tomorrow'::TIMESTAMP, 'allballs'::TIME;