×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

running total field cannot be created

running total field cannot be created

running total field cannot be created

(OP)
I am creating a crystal report.  This is what you would see in the crystal report.  This is NOT a database table. I can show you better than I can explain:

type_of_deduction   YDT_deductions     Selected_deductions
a                   20                  
b                   30                 30
c                   40
d                   50                 50


I am using an If then statement to get the "selected_deductions".  I just want certain deductions in this field...not all of them.  The problem I am having is I can't total those selected deductions.  I have used the sum expression but get the message "running total cannot be created.  ANY SUGGESTIONS?
 

RE: running total field cannot be created

Post your exact if-then statement, and we will tell you why.

Ken Hamady
http://www.kenhamady.com/
On-site custom Crystal Reports Training and Consulting.
Quick Reference Guide to using Crystal in VB.

RE: running total field cannot be created

(OP)
This is my If Then statement for selected_deduction:

WhilePrintingRecords;

If ({PR4_EmployeeEarningDeduction.RecordType} = "D" and
    {PR4_EmployeeEarningDeduction.EarningsDeductionCode} = "S") Or
        
    ({PR4_EmployeeEarningDeduction.RecordType} = "D" and    
    {PR4_EmployeeEarningDeduction.EarningsDeductionCode} = "V") Or
            
    ({PR4_EmployeeEarningDeduction.RecordType} = "D" and       
    {PR4_EmployeeEarningDeduction.EarningsDeductionCode} = "D") Or
              
    ({PR4_EmployeeEarningDeduction.RecordType} = "D" and            
    {PR4_EmployeeEarningDeduction.EarningsDeductionCode} = "L") Or
                
    ({PR4_EmployeeEarningDeduction.RecordType} = "D" and
                {PR4_EmployeeEarningDeduction.EarningsDeductionCode} = "CA")
     then {PR4_EmployeeEarningDeduction.YtdDeductionAmount};

I am wanting to sum up the results of this equation in a new field.

RE: running total field cannot be created

Your formula will be fine if you take out the "WhilePrintingRecords" line.   

Although it will be simpler if you write:

If ({PR4_EmployeeEarningDeduction.RecordType} = "D" and {PR4_EmployeeEarningDeduction.EarningsDeductionCode} in ["S","V","D","L","CA"]
then {PR4_EmployeeEarningDeduction.YtdDeductionAmount}

Ken Hamady
http://www.kenhamady.com/
On-site custom Crystal Reports Training and Consulting.
Quick Reference Guide to using Crystal in VB.

RE: running total field cannot be created

(OP)
It worked!!!!!!!!!!!!  THANKS!!!!!!

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close