We are working on a scheduled report to email us all survey results for the past 7 days. For that, we are trying to build up a query that can extract the required survey results and we fail to do so as the queries are not generating any output nor error.
Appreciate any guidance on this.
The query we used, which gave no output even though we have survey results within last 7 days:
SELECT * FROM Survey_Response_Main WHERE responsetime >= EXTRACT(epoch FROM CURRENT_DATE)::BIGINT AND responsetime < EXTRACT(epoch FROM CURRENT_DATE + INTERVAL '7 day')::BIGINT;
We believe the longint of responsetime is not helping us to do the required filtering.
Is there any guideline on how 'responsetime' should be filtered?