mleiser Posted September 2, 2013 Posted September 2, 2013 To make my request simple, suppose I have multiple children records for each parent record. In each child record there is a number. I want to add up that number from each of the children records for each parent and put that total in the parents record. I know you can have summaries on a report, but how do you get the total into the parents record? As an example, if each child record contains the amount of a tuition payment for a particular family. There are a number of these payments during the year. I want to total that amount for the year and put that amount into the parent record as total tuition paid by each family for the year. Make sense? Help?
rivet Posted September 2, 2013 Posted September 2, 2013 Every time a child record is created or modified (Script Trigger / OnRecordCommit ) push the total of all the child records with the same parent ID to desired field in the parent record. You can do it with a relationship or ExecuteSQL: ExecuteSQL ( " SELECT sum ( c.amount ) FROM child c WHERE c.id_parent = " ; ", " ; "¶"; id_parent )
Rick Whitelaw Posted September 3, 2013 Posted September 3, 2013 The Sum function will add up all the numbers of related child records. The calc field using the Sum function would be in the parent table.
Recommended Posts
This topic is 4159 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