jakebur01 Posted March 14, 2011 Share Posted March 14, 2011 How can I query for orders above 30% margin, orders below 15% margin, and orders below cost WHERE invoice date = tomorrow. Here are the fields I am working with: INVNO //invoice number IVDTE // invoice date CUSTNO //customer number COMPANY // company ITOTAL //invoice total ICOST //invoice cost I can query for orders below cost, but I am not advanced enough to query margins. - Jake. Quote Link to comment https://forums.phpfreaks.com/topic/230629-querying-for-margin/ Share on other sites More sharing options...
Maq Posted March 14, 2011 Share Posted March 14, 2011 Percentages come down to basic arithmetic, which MySQL can handle. A 30% margin is simply: .3 x cost. Quote Link to comment https://forums.phpfreaks.com/topic/230629-querying-for-margin/#findComment-1187493 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.