Basically I have a PostGIS layer with a date column.
I only need to show features that have the last week as a value in the date column. How to achieve this?
now() - 1 week doesn't seem to work
If you want to completly filter out the records, i.e. set a filter at the layer level, you can use the Postgres function to create an interval:
"update_date" >= (CURRENT_DATE - interval '1 week')
If you want to style/label the records differently, you can use the
age function to return a timespan between two dates, and the
week function to extract the number of weeks.
To get result from last week, the rule filter would be:
You should use
NOW() - INTERVAL '1 week'
now() - 1 week