3 Replies Latest reply on Jan 7, 2019 8:18 AM by Luis Isoldi

    Problem with Relative Date Filter

    Luis Isoldi

      Hello guys!

       

      I'm trying to build an fully automated info dashboard for my company.

      Problem is that RELATIVE DATE filter doesn't work for me.

      My guess is that the problem lies within NOW parameter, here is what I got:

       

      ERROR: column "day" does not exist; Error while executing the query

      SELECT COUNT(DISTINCT "users"."id") AS "ctd:id (users):ok", (((CAST(EXTRACT(YEAR FROM CAST("users"."created_at" AS TIMESTAMP WITHOUT TIME ZONE)) AS INTEGER) * 10000) + (CAST(EXTRACT(MONTH FROM CAST("users"."created_at" AS TIMESTAMP WITHOUT TIME ZONE)) AS INTEGER) * 100)) + CAST(EXTRACT(DAY FROM CAST("users"."created_at" AS TIMESTAMP WITHOUT TIME ZONE)) AS INTEGER)) AS "md:created_at (users):ok" FROM "public"."sales_orders" "sales_orders" INNER JOIN "public"."clientships" "clientships" ON ("sales_orders"."clientship_id" = "clientships"."id") INNER JOIN "public"."users" "users" ON ("clientships"."user_id" = "users"."id") INNER JOIN "public"."sales_items" "sales_items" ON ("sales_orders"."id" = "sales_items"."sales_order_id") INNER JOIN "public"."timeslots" "timeslots" ON ("sales_items"."id" = "timeslots"."sales_item_id") WHERE (("users"."created_at" >= DATEADD(DAY,-7,CAST(DATE_TRUNC( 'DAY', CAST(SYSDATE AS TIMESTAMP WITHOUT TIME ZONE) ) AS TIMESTAMP WITHOUT TIME ZONE))) AND ("users"."created_at" < DATEADD(DAY,1,CAST(DATE_TRUNC( 'DAY', CAST(SYSDATE AS TIMESTAMP WITHOUT TIME ZONE) ) AS TIMESTAMP WITHOUT TIME ZONE)))) GROUP BY 2