kyariexcel
Programmer
So I'm trying to make a gross profit report for my boss, and to do that we want to compare all items on all invoices per order with their unit price against their unit cost. So all's going well, until I start noticing that the cost of each item displayed in Order Entry doesn't always match the UNITCOST field in the OEINVD table. Sometimes it does match, however there are two other fields that appear to be sometimes used: AVGCOST and MOSTREC. This impacts my ability to make the report in SQL because I don't know when to use which field for the calculation.
My question is - can I find another field and/or another table that will help me always get the cost of the item for that particular invoice?
Here's my current SQL query:
SELECT oeinvd.ordnumber AS ordernum,
oeinvd.item AS item,
oeinvd.qtyshipped * oeinvd.unitcost AS cost,
oeinvd.qtyshipped * oeinvd.unitprice AS price
FROM oeinvd
WHERE oeinvd.linetype = 1
It must be possible somehow, because ACCPAC always displays the "right" value - I just don't know where to look in the SQL database.
My question is - can I find another field and/or another table that will help me always get the cost of the item for that particular invoice?
Here's my current SQL query:
SELECT oeinvd.ordnumber AS ordernum,
oeinvd.item AS item,
oeinvd.qtyshipped * oeinvd.unitcost AS cost,
oeinvd.qtyshipped * oeinvd.unitprice AS price
FROM oeinvd
WHERE oeinvd.linetype = 1
It must be possible somehow, because ACCPAC always displays the "right" value - I just don't know where to look in the SQL database.