Here is a query my accountant asked for today, thought I would share it.
Cheers,
DW
SELECT sum(procfee) as 'Total Fee',
COUNT(DISTINCT AptNum) as 'Number Of Appointments',
sum(procfee)/COUNT(DISTINCT AptNum) as 'Ave Fee/Visit' from procedurelog
WHERE procStatus=2
AND procDate>='2007-01-01'
AND procDate< '2007-12-31'