Creating an Average Days Field in a Report

cross5900

Blarg!
Local time
Yesterday, 21:47
Joined
Mar 24, 2006
Messages
92
Code:
SELECT UCase(Users.UserName) AS Associate, Count(Users.UserName) AS Pending, Sum(IIf(Date()-[DateNotified]<16,1,0)) AS [0-15 Days], Sum(IIf(Date()-[DateNotified]>15 And Date()-[DateNotified]<31,1,0)) AS [16-30 Days], Sum(IIf(Date()-[DateNotified]>30 And Date()-[DateNotified]<46,1,0)) AS [31-45 Days], Sum(IIf(Date()-[DateNotified]>45 And Date()-[DateNotified]<60,1,0)) AS [46-59 Days], Sum(IIf(Date()-[DateNotified]>=60,1,0)) AS [60+ Days]
FROM Information_tbl INNER JOIN Users ON Information_tbl.Associate = Users.UserID
GROUP BY Users.UserName, Information_tbl.IsActive
HAVING (((Information_tbl.IsActive)=False));

DateNotified - is a date/time field in the table.

---------
I am trying to create a field labeled Avg. Days. This field takes the information from the 0-15,16-30, etc. fields in the code and shows the average day of the total accounts for that associate.

I am having a hard time with trying to figure out where to even start this, any help would be greatly appreciated. Thanks.
 

Users who are viewing this thread

Back
Top Bottom