Forget about the date1 and date2.
I'm not sure if you are working with a form/report/ or query.
But to do what you want to do you have to first get a set of data that has
the count calculated as a field in the data view (see query 2 below)
Then you can calculate the average count.
So first you want a query that returns the count for each day.
Then you want a query that averages that count.
otherwise you will be getting an average for the original field values.
or
You will have to build a vba function to return the average of the count
Here is an example from one of my databases: To start I have a query that
returns the date and a traffic count for a road (Query1)
---------------------
Query1 Date TrafficCount
1/1/1994 269
1/1/1997 204
8/7/1997 51
1/1/1998 55
11/5/1999 151
11/5/1999 65
11/5/1999 60
11/15/1999 83
11/15/1999 34
11/15/1999 50
11/15/1999 87
5/7/2001 39
5/7/2001 66
5/22/2001 121
5/22/2001 128
5/22/2001 102
5/22/2001 102
5/22/2001 64
5/29/2001 23
5/29/2001 51
--------------------
SELECT Query1.Date, Count(Query1.TrafficCount) AS CountOfTrafficCount
FROM Query1
GROUP BY Query1.Date;
Query2 Date CountOfTrafficCount
1/1/1994 1
1/1/1997 1
8/7/1997 1
1/1/1998 1
11/5/1999 3
11/15/1999 4
5/7/2001 2
5/22/2001 5
5/29/2001 2
--------------------------------------------------------------
SELECT Avg(Query2.CountOfTrafficCount) AS AvgOfCountOfTrafficCount
FROM Query2;
Query3 AvgOfCountOfTrafficCount
2.22222222222222
Which is what I think you are asking for.
If you want the average of all the rows.
--------------------------------------------------------
SELECT Avg(Query1.TrafficCount) AS AvgOfTrafficCount
FROM Query1;
Query3 AvgOfTrafficCount
90.25
----------------------------------------
but if you want the average traffic count for each date then you would have:
SELECT Query1.Date, Avg(Query1.TrafficCount) AS AvgOfTrafficCount
FROM Query1
GROUP BY Query1.Date;
Query3 Date AvgOfTrafficCount
1/1/1994 269
1/1/1997 204
8/7/1997 51
1/1/1998 55
11/5/1999 92
11/15/1999 63.5
5/7/2001 52.5
5/22/2001 103.4
5/29/2001 37
Ed Warren.