Skip to Content

is this calculation possible in any way?

We have added a second discount table to Sales Quotation to specify for our customers what their additional discount in percent is on top of their regular discount. 

And now I'd like to tell the linetotal what the total becomes when they put in a value in the extra discount field. No problem calculating it ones, but if there has been a value in the extra discount field and then they would like to change it, it just adds the discount ontop of the already discounted price. 

This is how I first did it

SELECT SUM($[$38.17.number]-($[$38.17.number]*($[$38.U_Extra.number]/100)))*$[$38.11.number] FROM DUMMY


But that makes it impossible to change the extra discount without also changing the regular discount first in QUT1.DiscPrcnt

Then I figured I want it to always start with calculating the original price, but here is where it is not possible? I have done it like this:

SELECT SUM(($[$38.14.number]*$[$38.11.number])-(($[$38.14.number]*$[$38.11.number])*($[$38.U_Origindisc.number]/100)))-
SUM(($[$38.14.number]*$[$38.11.number])-(($[$38.14.number]*$[$38.11.number])*($[$38.U_Origindisc.number]/100)))*($[$38.U_Extra.number]/100))) FROM DUMMY


Is my way of thinking all wrong or is it just my limited knowledge of SQL?! :)

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

0 Answers