Mark,
I've attached a couple reports. For the Steiner 2022 and Steiner 2021 you will need to look at the NMTD and PMTD. On the 2022 report it shows a total of $30804.00 for PMTD sales YET on the 2021 report it shows $37,866.00 for the NMTD (which is the other reports PMTD. It doesn't make and sense to me. The information is coming from the same table, same fields. I think for this issue its that the report only shows sales from the current distributors for this year and drops any from the report that were sales last year for the same month. I need the report to show this years monthly sales and ANY sales from last year same period.
I just don't see how this can be so complicated.
The fields are :
Manufacturer
Distributor
Date (WTF field)
NMTD (monthly sales)
PMTD - not working right
var date datevariable = AdjustYear([WTF], -1);
//$datevariable
SumValues(GetRecords("{9.EX.'"& [Distributor] &"'} AND {12.EX.'"& [Manufacturer] &"'} AND {11.OBF.'"& $datevariable &"'} AND \n{11.OAF.'"& FirstDayOfMonth($datevariable) &"'}"), 159)
YTD - not working right
var date datevariable = FirstDayOfYear([WTF]);
//$datevariable
SumValues(GetRecords("{9.EX.'"& [Distributor] &"'} AND {12.EX.'"& [Manufacturer] &"'} AND {11.OAF.'"& $datevariable &"'} AND \n {11.OBF.'"& [WTF] &"'}"), 159)
PYTD - not working right
var date datevariable = AdjustYear([WTF], -1);
//$datevariable
SumValues(GetRecords("{9.EX.'"& [Distributor] &"'} AND {12.EX.'"& [Manufacturer] &"'} AND {11.OBF.'"& $datevariable &"'} AND {11.OAF. '"& FirstDayOfYear ($datevariable) &"'}"), 159)
Any thoughts would be appreciated.
Lori