Hi, I have a issue with trying to do a calculation within a SELECT Query. I want to Add the values of two fields together and then subtract the other two and put them into an AS AvailQty. I am able to output the value after the query, but unable to ORDER BY with that value. Any thoughts? The code is :
$getWHSE = mysql_query("SELECT (QtyOnHand + Qty_PO - (Qty_BO + Qty_SO)) AS AvailQty FROM IS_Qty WHERE AvailQty >= 1 ORDER BY AvailQty DESC LIMIT 1");
Please help!
Thanks
-- This message may have been cut off and the rest will only be shown to members. To become a member, click here --