Jump to content

Doing math one the query line


AV1611

Recommended Posts

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.00
ORDER BY
  Part_Stock."STK_06" ASC
[/code]
Link to comment
Share on other sites

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]
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.