Print Page | Close Window

problem with sum

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Report Design
Forum Discription: The best way to design a report and problems you have encountered
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=1491
Printed Date: 01 May 2024 at 6:34pm


Topic: problem with sum
Posted By: bepo
Subject: problem with sum
Date Posted: 11 Oct 2007 at 12:25am
Hello!
In database I have two tables:

Students (idStudent, name, surname, dateOfBirth, schoolFee, numberOfRates)
Student(idStudent, rateNumber, amount, dateOfPay)

In crystal report I want to display all students, and they sum of payment of schoolfee but only if dateOfPay is within last month.

name surname dateOfBirth schoolFee @SumOfStudentAmounts

It is easy to display all students information, but I don't know how to create formula that will calculate what sum of amount did student payed?

How to create that formula (@SumOfStudentAmounts)?


Thanks!

Josip



Replies:
Posted By: yggdrasil
Date Posted: 11 Oct 2007 at 5:42am
I think I'd use a Running Total. rather than a formula.
First Insert a Group on idStudent. 
Then for theRunning total,  sum the Amount .
Evaluate using a formula based on the DateofPay to only select those within the period you want.
Reset on change of group, ie for each student 



Print Page | Close Window