also, shouldn't those 2 tables be joined together some how?
They are...not sure why the first post didn't include all of the query
cffunction name=getAverageTotalCalls access=public
cfargument name=employeeID type=numeric required=yes
cfargument name=dateWorked
Shouldn't it be?
SELECT avg(da.connects+ sum(ad.acd)) as averageTotalCalls
I changed it and still got the same error:
Invalid use of group function
~|
Order the Adobe Coldfusion Anthology now!
can you provide a couple rows of data with no functions? just the ad.acd and
the da.connects?
and what you would like for it to show? whenever you use an aggregate
function like avg you have to use group by
like
select studentId, avg(grade)
from grades
group by studentId
On Thu, Mar 10, 2011
can you provide a couple rows of data with no functions? just the ad.acd and
the da.connects?
and what you would like for it to show? whenever you use an aggregate
function like avg you have to use group by
like
select studentId, avg(grade)
from grades
group by studentId
On Thu, Mar 10, 2011
can you provide a couple rows of data with no functions? just the ad.acd and
the da.connects?
and what you would like for it to show? whenever you use an aggregate
function like avg you have to use group by
like
select studentId, avg(grade)
from grades
group by studentId
Yes sorry I misread
So you want : (13 + 192) / 2?
Or do you need 192/13 ?
On Thu, Mar 10, 2011 at 2:07 PM, Torrent Girl moniqueb...@gmail.com wrote:
can you provide a couple rows of data with no functions? just the ad.acd
and
the da.connects?
and what you would like for it to show? whenever you use an
select avg(connects + acd) from (
SELECT da.connects as connects, sum(ad.acd) as acd
FROM dialeragent da, agentDaily ad WHERE da.employeeID = ? AND da.employeeID
= ad.employeeID AND da.dateWorked = ? AND ad.dateWorked = ? group by
connects
)
On Thu, Mar 10, 2011 at 2:20 PM, Greg Morphis
Hi All
I have the following function that I am TRYING to get the average of a sum of 2
added values.
cffunction name=getAverageTotalCalls access=public
cfargument name=employeeIDtype=numeric required=yes
cfargument name=dateWorkedtype=string required=yes
Shouldn't it be?
SELECT avg(da.connects+ sum(ad.acd)) as averageTotalCalls
Regards,
Andrew Scott
http://www.andyscott.id.au/
-Original Message-
From: Torrent Girl [mailto:moniqueb...@gmail.com]
Sent: Thursday, 10 March 2011 1:00 PM
To: cf-talk
Subject: using sum with average
also, shouldn't those 2 tables be joined together some how?
On Wed, Mar 9, 2011 at 8:00 PM, Torrent Girl moniqueb...@gmail.com wrote:
Hi All
I have the following function that I am TRYING to get the average of a sum
of 2 added values.
cffunction name=getAverageTotalCalls access=public
10 matches
Mail list logo