sportypants Posted May 10, 2006 Share Posted May 10, 2006 Hello,Please can someone try and help me with the following query I have to get working for a college assignment:$query = "SELECT *, sqrt(pow(tblcalc.sum1, 2) + pow(tblcalc.sum2, 2)) / 4 as SUMTOTAL FROM tblsums WHERE SUMTOTAL < $VAR ORDER BY $orderby $sort ";I have named the sum 'SUMTOTAL' which works fine my problem is when I try to show only 'SUMTOTAL' which is < $VAR the query produces an error "Unknown Column 'SUMTOTAL' in where clause'I would be very grateful for any advice or help anyone can offer me.Thank you kindly,JJ Quote Link to comment Share on other sites More sharing options...
sportypants Posted May 10, 2006 Author Share Posted May 10, 2006 Got it working thank you. Replaced Where with Having and worked fine. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.