Solved!!!
Doug B. ----- Original Message ----- From: "Doug Brown" <[EMAIL PROTECTED]> To: "CF-Talk" <[email protected]> Sent: Saturday, January 13, 2007 6:53 AM Subject: What am I missing? > I am quering the database in the following and getting the average of feedback received. I pass the memberID to the function which I have verified to exist and I get nothing back. If I run the same query in the query analyzer I get a result of 2. Can anyone see a problem? > > <!---GET THE AVG OF RATINGS FOR USERS---> > > <CFFUNCTION name="InitAvgFeedback" access="public" output="false" returntype="string" hint="Output the average rating for all feedback per member"> > <CFARGUMENT name="memberID" required="yes" type="numeric"> > > <cfset var RatingAverage = ""> > > <CFQUERY datasource="#APPLICATION.DB#" username="#APPLICATION.UN#" password="#APPLICATION.PW#"> > select avg(rating) AS ratings > from #APPLICATION.DBPRE#memberRatings > where TAuthorID = <CFQUERYPARAM cfsqltype="cf_sql_bigint" value="#ARGUMENTS.MEMBERID#"> > </CFQUERY> > > <CFRETURN RatingAverage> > </CFFUNCTION> > > Then my invocation > > <CFINVOKE component="advertiser.components.commonQrys" > method = "returnAverage" > memberID = "#Val(attributes.memberID)#" > returnvariable = "RatingAverage"> > </CFINVOKE> > > Where I want to use it > > > <img src="images/#ratingAverage#_star.gif" border="0" align="absmiddle" alt="#ratingAverage# Star Rating!!" /> > > Doug B. > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Create robust enterprise, web RIAs. Upgrade & integrate Adobe Coldfusion MX7 with Flex 2 http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:266494 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

