BrownFedora Posted May 1, 2004 Posted May 1, 2004 We have a donation table with fields ID, Date, and Amount We have a calculation field "CurrentYearTotal" that needs to display the sum of all donations (a sum of donations) made within the current year (Jan. 1st to today) Can we do this with out a script and just a Calculation Field? So basically how do I restrict the records that are summed without dong a find. We don't want to do a find because we want to be able to see all time grand total next to current year total. I'll capitulate if a script is the only way to do it but I really prefer not to use one.
-Queue- Posted May 1, 2004 Posted May 1, 2004 You can do it, but it may run much more slowly than a script if you have a large number of records. You need a calculation number field cYearDate equal to Year(Date), an unstored calculation number field cYearNow equal to Year(Get(CurrentDate)), a self-relationship from cYearNow to cYearDate, and your CurrentYearTotal field equal to Sum(selfrel::Amount).
Recommended Posts
This topic is 7511 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now