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