on 09-29-2008 6:37 PM
I am trying to write a query show the per unit commission for an item on a Sales Order and put that value into a UDF.
I have got as far as getting a result on the document for a specific row, but I cannot get it to select for all rows on the document.
What I have is as follows:
SELECT (T0.Price* T0.Commission/100)
FROM RDR1 T0 INNER JOIN ORDR T1 ON T0.DocEntry = T1.DocEntry
WHERE T1.DocNum = $[$8.0] AND T0.ItemCode = $[$38.0]
It is the last part where I am trying to specify by itemcode that is proving troublesome. I have used a specific line number instead of ItemCode and that works.
Can someone help me on this?
Rick Winn
The syntax for ItemCode on the marketing document is $\[$38.1.0]
You simply need
SELECT ($\[$38.17.Number]*$\[$38.28.Number]/100)
38.17 refers to Price After Discount column and 38.28 refers to the commission column
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
How do I get 2 decomal places for the second query?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you worked perfectly.
Rick
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
103 | |
12 | |
11 | |
6 | |
5 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.