I want to display current date and previous 7 days. the query doesnt work for me.
SELECT * FROM dummy WHERE entry_date between current_date and current_date at time zone 'UTC' - interval '7 days
Advertisement
Answer
I doubt you have future entry dates. So don’t use between
. Instead:
where entry_date >= current_date at time zone 'UTC' - interval '7 days'
Note: If you want to count the current date as a day, then you want interval '6 days'
.