Average of a Date Field

C

clk

Hi. I have a table (tblOrders). I would like to get the average date
of the last ten orders. So far this is what I have:

SELECT TOP 10 Avg(tblOrder.OrderEntered) AS AvgOfOrderEntered,
tblOrder.OrderReceived
FROM tblOrder
GROUP BY tblOrder.OrderReceived
ORDER BY Avg(tblOrder.OrderEntered) DESC;

What this gives me is the last ten orders but the AvgOfOrderEntered
field becomes a number field. Is it possible to just get the average
of a date field?

Any help is appreciated.
 
K

KARL DEWEY

Try this --
SELECT TOP 10 Format(Avg(tblOrder.OrderEntered), "m/d/yyyy") AS
AvgOfOrderEntered, tblOrder.OrderReceived
FROM tblOrder
GROUP BY tblOrder.OrderReceived
ORDER BY Avg(tblOrder.OrderEntered) DESC;
 
J

Jeff Boyce

Perhaps we don't share the same definition of "average" ... but then, I'm a
recovering statistician.

What (mathematically) do you want to do with the range of dates?

Regards

Jeff Boyce
Microsoft Office/Access MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top