AV1611 Posted May 31, 2006 Share Posted May 31, 2006 in this query, I am trying to make an extra field named VALUE with the math as shown... but it is obviously not right, as it doesn't work... Any suggestion on how to do it correctly?[code]SELECT Part_Stock."PRTNUM_06", Part_Stock."STK_06", Part_Stock."QTYOH_06", Part_Master."MATL_01", Part_Master."CSTCNV_01" [b]Part_Stock."QTYOH_06"*Part_Master."MATL_01"/Part_Master."CSTCNV_01" as VALUE[/b]FROM "MAXDAT"."Part Stock" Part_Stock INNER JOIN "MAXDAT"."Part Master" Part_Master ON Part_Stock."PRTNUM_06" = Part_Master."PRTNUM_01"WHERE Part_Stock."QTYOH_06" > 0.00ORDER BY Part_Stock."STK_06" ASC [/code] Quote Link to comment https://forums.phpfreaks.com/topic/10860-doing-math-one-the-query-line/ Share on other sites More sharing options...
poirot Posted May 31, 2006 Share Posted May 31, 2006 Have you tried to remove all the double quotes?Also, I am not used to JOIN's, but it seems there's something wrong near the JOIN part.Does MySQL throw an error? Quote Link to comment https://forums.phpfreaks.com/topic/10860-doing-math-one-the-query-line/#findComment-40575 Share on other sites More sharing options...
AV1611 Posted May 31, 2006 Author Share Posted May 31, 2006 Quotes are needed (not writing this to mysql, using PervasiveSQL)If I drop the math line, the query runs fine. the JOINS is not a problem...[!--quoteo(post=378721:date=May 31 2006, 10:47 AM:name=poirot)--][div class=\'quotetop\']QUOTE(poirot @ May 31 2006, 10:47 AM) [snapback]378721[/snapback][/div][div class=\'quotemain\'][!--quotec--]Have you tried to remove all the double quotes?Also, I am not used to JOIN's, but it seems there's something wrong near the JOIN part.Does MySQL throw an error?[/quote] Quote Link to comment https://forums.phpfreaks.com/topic/10860-doing-math-one-the-query-line/#findComment-40581 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.