first off, is contestantid a number?  in the second one you treat it as a
string.  just remove the ' marks.

secondly, are you trying to get ALL contestents, or just the specific one?
if just the one, your second GROUP BY clause should be a WHERE contestentid
= .

thirdly, why are you querying the DB twice when you already have
contestentid?

chris olive, cio
cresco technologies
[EMAIL PROTECTED]
http://www.crescotech.com



-----Original Message-----
From: Jay Patton [mailto:[EMAIL PROTECTED]]
Sent: Monday, February 05, 2001 6:07 PM
To: CF-Community
Subject: Wrong output


i am looking for a little help on this statement. what i want for it to do
is grab the point totals from the feilds called in the statement and then
total them and out put the total for the said contestant. this is what i
have: (the answer should be 595 but i get 2,630. if anyone can help from
what i give you here that would be great and if you need more info just let
me know.... thanks,
<!--

<cfquery name="GetName"
         datasource="rodeo"
         dbtype="ODBC">
SELECT ContestantID
FROM ContestantManager
WHERE ContestantID = #url.ContestantID#
</cfquery>

<cfquery name="GetTotalPts"
         datasource="rodeo"
         dbtype="ODBC">
SELECT SUM (FirstPlaceAdjPts + FirstPlacePts + SecondPlacePts +
SecondPlaceAdjPts + ThirdPlacePts + ThirdPlaceAdjPts + FourthPlacePts +
FourthPlaceAdjPts + FithPlacePts + FithPlaceAdjPts + SixthPlacePts +
SixthPlaceAdjPts) as TOTALPTS
FROM ResultManager
GROUP BY '#GetName.ContestantID#'
</cfquery>

-->
Thanks again,
Jay Patton
Web Pro USA
406.549.3337 ext. 203
1.888.5WEBPRO
www.webpro-usa.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to