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
------------------------------
Question
Need help with a formula that is asking for last year
This topic has been closed for replies.
Sign up
Already have an account? Login
Login to the community
Login with Quickbase US – quickbase.com Login with Quickbase EU – quickbase.eu
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.