I am trying to validate some data for our team and am stuck trying understand the data layout. My boss is using stonefield reports to generate a monthly sales report and he has 2 versions generating different #s. There seems to be confusion on what date (docdate, postdate, etc.) should be used.
So I sort through the tables/date that made sense to me from here: https://sageaom.kcsvar.com/AOM2017/Advantage.xml and came up with the following query to sum invoices for a month:
Select sum(INVSUBTOT) FROM [COMPANY]..OEINVH where [INVFISCYR] = '2022' AND [INVFISCPER] = '9'
Select sum(CRDTOTAL)*-1 FROM [COMPANY]..OECRDH where [INVFISCYR] = '2022' AND [INVFISCPER] = '9'
The sum of those two do not seem to match the sales history report I pull from out of OE. OE Sales History Report is nearly half of what this query generates
What am I missing?