>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"         type="string"   required="yes">
       
  <cfquery name="getAverageTotalCalls" datasource="xxx">
    SELECT avg(da.connects)+avg(sum(ad.acd)) as averageTotalCalls
    FROM dialeragent da, agentDaily ad
    WHERE da.employeeID = <cfqueryparam value="#arguments.employeeID#" 
cfsqltype="CF_SQL_NUMERIC" />
    AND  da.employeeID = ad.employeeID
    AND  da.dateWorked  =  <cfqueryparam 
value="#dateFormat(arguments.dateWorked, 'YYYY-MM-DD')#" 
cfsqltype="CF_SQL_DATE" />
     AND  ad.dateWorked                 =  <cfqueryparam 
value="#dateFormat(arguments.dateWorked, 'YYYY-MM-DD')#" 
cfsqltype="CF_SQL_DATE" />
        </cfquery>
  <cfreturn getAverageTotalCalls>
</cffunction> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:342903
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to