Che, SUM is an aggregate function and cannot appear in a WHERE without a HAVING or SUBSELECT or subquery.
If all you want to do is check for each row instead of the either table just do this: SELECT * FROM ORDERS WHERE (SubTotal + Shipping) = #FORM.TotalCharge# I tried it in SQL2000 and Oracle and it works. Mario -----Original Message----- From: Che Vilnonis [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 26, 2005 9:26 AM To: CF-Talk Subject: RE: : How would I re-write this SQL query??? not easy? -----Original Message----- From: Micha Schopman [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 26, 2005 9:24 AM To: CF-Talk Subject: RE: : How would I re-write this SQL query??? Euhm ... not? :) Micha Schopman Software Engineer Modern Media, Databankweg 12 M, 3821 AL Amersfoort Tel 033-4535377, Fax 033-4535388 KvK Amersfoort 39081679, Rabo 39.48.05.380 ------------------------------------------------------------------------ ------------------------------------------------------------------------ ----- Modern Media, Making You Interact Smarter. Onze oplossingen verbeteren de interactie met uw doelgroep. Wilt u meer omzet, lagere kosten of een beter service niveau? Voor meer informatie zie www.modernmedia.nl ------------------------------------------------------------------------ ------------------------------------------------------------------------ ----- -----Original Message----- From: Che Vilnonis [mailto:[EMAIL PROTECTED] Sent: woensdag 26 januari 2005 15:14 To: CF-Talk Subject: OT:: How would I re-write this SQL query??? This should be pretty easy for one of you SQL gurus out there... SELECT * FROM ORDERS WHERE SUM(SubTotal + Shipping) = #FORM.TotalCharge# Thanks, Che ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Find out how CFTicket can increase your company's customer support efficiency by 100% http://www.houseoffusion.com/banners/view.cfm?bannerid=49 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:191806 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

