Count and Average

kitty77

Registered User.
Local time
Today, 16:26
Joined
May 27, 2019
Messages
719
How can I count the records for each day (by date) and then get an average for each day? What is the best way?

Thanks...
 
Use aggregate (totals) query or queries.
First group records by date. Next add the date field again or ID field and change group by to Count.
Depending on what you want to average, do something similar but set to average
 
Yes this is a simple aggregate query, using common aggregate functions:

https://www.w3schools.com/sql/sql_count_avg_sum.asp


Code:
SELECT DateField, COUNT(DateField) AS RecordCount, AVG(FieldToAverage) AS AveragedField
FROM YourTableNameHere
GROUP BY DateField
 

Users who are viewing this thread

Back
Top Bottom