Y
Hacker News
new
|
ask
|
show
|
jobs
by
jontro
3304 days ago
Reading the end of the sentence "within the past week:" just above. However I would be interested to know if the "last week" date range is easily doable in postgres :)
1 comments
craigkerstiens
3304 days ago
Will try to clarify it a bit further. Offhand you could probably do something like the following to find if it fell within some week range:
created_at BETWEEN (date_trunc('week', now())) AND (date_trunc('week', now() - '1 week'::interval))
link
created_at BETWEEN (date_trunc('week', now())) AND (date_trunc('week', now() - '1 week'::interval))