Thanks.

I tried that, but the problem is that the function returns only one row as it 
is, but it returns one row for each item with the FK '9' (which is each thing 
within that category).

I can't mess with the function, it is from a different department and is used 
in other applications.

I also tried to make the result a list and use a ListFirst() and it still 
returned one number (the correct total) for each item selected in the query 
with the '9' FK.

>Without messing with the Function, you could throw MAXROWS attributes in
>the CFQuery tag maxrows="1". Not the "good" solution, but one that
>should work. 
>
>
>.....................
>Ben Nadel
>Certified Advanced ColdFusion MX7 Developer
>www.bennadel.com
> 
>Need ColdFusion Help?
>www.bennadel.com/ask-ben/
>
>-----Original Message-----
>From: John Seelye [mailto:[EMAIL PROTECTED] 
>Sent: Thursday, February 22, 2007 12:32 PM
>To: CF-Talk
>Subject: Help - need to show result only once
>
>This query calls a function in the database that gets the sum of the
>items returned with a category id 9 and a valid transaction number.
>
>The problem is that it returns one value for each item in the list of
>those ordered. What i need is to just show the total once.
>
><cfquery name="qGetCatTotal" datasource="RStore"> select
>ROL.getusercategoriestotal(#transaction#, 9); </cfquery>
>
>Returns this ...
>
>qGetCatTotal - query - Top 1 of 1 Rows
>       GETUSERCATEGORIESTOTAL
>1      648
>
>648
>qGetCatTotal - query - Top 1 of 1 Rows
>       GETUSERCATEGORIESTOTAL
>1      648
>
>648
>qGetCatTotal - query - Top 1 of 1 Rows
>       GETUSERCATEGORIESTOTAL
>1      648
>
>648
>qGetCatTotal - query - Top 1 of 1 Rows
>       GETUSERCATEGORIESTOTAL
>1      648
>
>648
>
>The 648 is right.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Upgrade to Adobe ColdFusion MX7
The most significant release in over 10 years. Upgrade & see new features.
http://www.adobe.com/products/coldfusion

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:270510
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to