Go Premium for a chance to win a PS4. Enter to Win

x
Solved

Getting the sum of a formula field in Crystal reports 8.5

Posted on 2006-11-30
Medium Priority
2,206 Views
I'm new to Crystal and have created this formula(@TotalCheckAmount):
IF ({PR1_EmployeeMaster.PayMethod} = "H")

The formula works fine but when I try to create a formula that will give me the sum; SUM {@TotalCheckAmount}
I get errors.  Is there a way to get this to work?

Thank you!
0
Question by:dxthorpe
• 2
• 2

LVL 2

Expert Comment

ID: 18049727
Create and add the following formulas to the Details section of your report:

//@Hourly Earnings
if ({PR1_EmployeeMaster.PayMethod} = "H")
else 0

//@Other Earnings
if ({PR1_EmployeeMaster.PayMethod} <> "H")
else 0

//@Total Earnings
({@Hourly Earnings} + {@Other Earnings})

I'm assuming that you have created a Group on the {PR1_EmployeeMaster.EmployeeNumber} field so simply include a Sum of {@Total Earnings} field in your Group Footer section to see that employees total.  If you want a grand total for all employees, then copy and past the Sum of {@Total Earnings} to the Report Footer section.

You can always suppress the Details section or any formula fields that you don't want visible in your report.

Jeff
0

LVL 35

Expert Comment

ID: 18049730
Hi

SUM (@TotalCheckAmount)

Regards
David
0

Author Comment

ID: 18049781
I'll give this a try and let you know how it goes.
0

LVL 2

Accepted Solution

ID: 18049824
By the way, dxthorpe, the reason that I provided you the solution that I did was so that you would have the luxury of generating totals/subtotals of Hourly Earnings and Other Earnings if you should so desire.  There is a simpler way to do it but I thought you might like the extra possibilities.

Jeff
0

Author Comment

ID: 18050014
Thanks this got me going in the right direction.
0

Featured Post

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Screencast - Getting to Know the Pipeline
Suggested Courses
Course of the Month12 days, 21 hours left to enroll