Jump to content


Photo

Doing math one the query line


  • Please log in to reply
2 replies to this topic

#1 AV1611

AV1611
  • Members
  • PipPipPip
  • Advanced Member
  • 997 posts

Posted 31 May 2006 - 02:04 PM

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?

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.00
ORDER BY 
  Part_Stock."STK_06" ASC 


#2 poirot

poirot
  • Members
  • PipPipPip
  • Advanced Member
  • 646 posts
  • LocationAustin, TX

Posted 31 May 2006 - 02:47 PM

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?
~ D Kuang

#3 AV1611

AV1611
  • Members
  • PipPipPip
  • Advanced Member
  • 997 posts

Posted 31 May 2006 - 02:55 PM

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) View Post[/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]





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users