SQL - Number Appointments Grouped by Date / Time
v7,v6
See Create Export to CSV using SQL Query for information on using query below for export to csv.
select extract(WEEKDAY from "Date"),
case extract(WEEKDAY from "Date")
when 0 then 'Sunday'
when 1 then 'Monday'
when 2 then 'Tuesday'
when 3 then 'Wednesday'
when 4 then 'Thursday'
when 5 then 'Friday'
when 6 then 'Saturday'
end "Week Day", extract(Hour from "Start") "Time", count(*) "Appointments" from "Diary_Main" DM
where "Apt_Type" = 1
and "Diary_Status" <> 16
and "Dry_Num" = 1
//and "Date" between :DateLo/*Date*/ and :DateHi/*Date To*/
group by 1,2,3
order by 1,3