TAC Appt - Tourplus
view name = 'tac_appt_tourplus'
[NEW] Query
SELECT date_trunc('day'::text, "tourPlus_date")::date AS date,
to_char(date_trunc('month'::text, "tourPlus_date")::date::timestamp with time zone, 'YYYY Mon'::text) AS month,
(to_char(date_trunc('week'::text, "tourPlus_date")::date::timestamp with time zone, 'DD Mon'::text) || ' - '::text) || to_char(date_trunc('week'::text, "tourPlus_date")::date + '6 days'::interval, 'DD Mon'::text) AS week,
branch,
contact_owner,
assigned_pic,
created_by,
count("tourPlus_date") AS appt_tourplus
FROM appt
WHERE hide IS NULL OR hide = false
GROUP BY (date_trunc('week'::text, "tourPlus_date")::date), (date_trunc('day'::text, "tourPlus_date")::date), (to_char(date_trunc('month'::text, "tourPlus_date")::date::timestamp with time zone, 'YYYY Mon'::text)), ((to_char(date_trunc('week'::text, "tourPlus_date")::date::timestamp with time zone, 'DD Mon'::text) || ' - '::text) || to_char(date_trunc('week'::text, "tourPlus_date")::date + '6 days'::interval, 'DD Mon'::text)), branch, contact_owner, assigned_pic, created_by
ORDER BY (date_trunc('day'::text, "tourPlus_date")::date);
Last updated