Average Duration of time

  • Thread starter Thread starter ken
  • Start date Start date
K

ken

I am using the following query to list the opendate and the duration a call
has been opened.
How can I get the average duration a call is opened for each month.

SELECT calls.OpenDate, DateDiff("n",[Time_In],[Time_Out])\60 & ":" &
Format(DateDiff("n",[Time_In],[Time_Out]) Mod 60,"00") AS Duration
FROM calls;

Thanks
Ken
 
I think you MIGHT get it with something like the following, although I've
probably screwed up the placement of the parentheses.

SELECT calls.OpenDate,
Avg(DateDiff("n",[Time_In],[Time_Out]))\60 & ":" &
Format(Avg(DateDiff("n",[Time_In],[Time_Out])) Mod 60,"00") AS Duration
FROM calls
Group by Format(Calls.OpenDate, "YYYY-MM")
 
Back
Top