Hi, I'm writing a Postgres native SQL query and I am adding filters manually.
SELECT count(*) AS "count", (date_trunc('week', CAST((CAST(to_timestamp("public"."my_database"."time") AS timestamp) + INTERVAL '1 day') AS timestamp)) - INTERVAL '1 day') AS "time"
FROM "public"."my_database"
WHERE {{City}} AND {{Shape}} AND {{Times}}
etc...
'City' and 'Shape' filters work well, whereas the 'Time' filter once selected for throws the error:
ERROR: cannot cast type integer to date Position: 417
Wonder what could cause this and how I could fix it. I have selected the time column as a UNIX timestamp in Data Model.
Thanks.