hi, i have the following query that retrieves the latest quiz date and quiz 
percent

SELECT MAX(QuizDate) as QuizDate, QuizID,
    QuizPercent = (SELECT QuizPercent FROM Test_Board_Acupuncture as t1
                          WHERE t1.Customer_ID = #COOKIE.TCMTests#
                          AND t1.QuizID = Test_Board_Acupuncture.QuizID
                          AND t1.QuizDate = 
MAX(Test_Board_Acupuncture.QuizDate))
FROM Test_Board_Acupuncture
WHERE Customer_ID = #COOKIE.TCMTests#
GROUP BY QuizID 

the problem is that if the student takes the same test back to back right away 
somteimes it can throw an error from the sub query

Diagnostics: Error Executing Database Query. [Macromedia][SQLServer JDBC 
Driver][SQLServer]Subquery returned more than 1 value. This is not 
permitted when the subquery follows =, !=, <, <= , >, >= or when the 
subquery is used as an expression.

is there a way of restructuring the query so that i can select the info without 
it triggering the error?

thank you.





~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

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

Reply via email to