LoriPelzel
2 years agoQrew Member
Need help with a formula that is asking for last year
var date datevariable = AdjustYear([WTF],-1);
SumValues(GetRecords("{9.EX.'"& [Distributor] &"'} AND {12.EX.'"& [Manufacturer] &"'} AND {11.OAF.'"& $datevariable &"'} AND \n {11.OBF.'"& [WTF] &"'}"), 159)
So this is saying sum the Year to Date value in field 159 when the Distributor and Manufacture are the same and the Date is last year.
WTF is the date field I'm trying to define as last year?
Something is wrong, it works perfectly when I use this for the current year-to-date total.
var date datevariable = FirstDayOfYear([WTF]);
SumValues(GetRecords("{9.EX.'"& [Distributor] &"'} AND {12.EX.'"& [Manufacturer] &"'} AND {11.OAF.'"& $datevariable &"'} AND \n {11.OBF.'"& [WTF] &"'}"), 159)
Thanks for your help!
Lori
------------------------------
Lori Pelzel
------------------------------
SumValues(GetRecords("{9.EX.'"& [Distributor] &"'} AND {12.EX.'"& [Manufacturer] &"'} AND {11.OAF.'"& $datevariable &"'} AND \n {11.OBF.'"& [WTF] &"'}"), 159)
So this is saying sum the Year to Date value in field 159 when the Distributor and Manufacture are the same and the Date is last year.
WTF is the date field I'm trying to define as last year?
Something is wrong, it works perfectly when I use this for the current year-to-date total.
var date datevariable = FirstDayOfYear([WTF]);
SumValues(GetRecords("{9.EX.'"& [Distributor] &"'} AND {12.EX.'"& [Manufacturer] &"'} AND {11.OAF.'"& $datevariable &"'} AND \n {11.OBF.'"& [WTF] &"'}"), 159)
Thanks for your help!
Lori
------------------------------
Lori Pelzel
------------------------------