Link to home
Start Free TrialLog in
Avatar of PresidentLincoln
PresidentLincolnFlag for United States of America

asked on

Crystal Reports - Add together rows with sums of 2 columns

I am currently writing a Crystal Report in CR 13 SP 12.   I have several rows that look like this:

Name           Service         Quantity         Time Spent
Jeff                Lawn                   1                    3 hours
Jeff                Lawn                   1                    4 hours 
Rick               Floors                  1                    2 Hours    
Rick               Floors                  1                    1 Hour   
Rick               Floors                  1                    3 Hours

Open in new window

     

What I need to do is combine the rows for each name, adding together the "Quantity" and "Time Spent" columns, so the output would look something like this:

Name            Services            Quantity           Time Spent
Jeff                 Lawn                   2                      7 Hours
Rick               Floors                  3                       6 Hours 

Open in new window


How would I go about combining the rows and getting sums in this way?  So far I've created grops for the names and for the Services, but can't break through that next wall.
ASKER CERTIFIED SOLUTION
Avatar of James0628
James0628

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Mike McCracken
Mike McCracken

I the time spent is a numeric field then James answer will work.  

If it is a string or text field then you will need a variable to convert it to a number then do the sum.

     Val({TimeSpent})

mlmcc
If it is a string or text field then you will need a variable to convert it to a number then do the sum.
I think you meant "formula", not "variable".  :-)  Just trying to avoid any possible confusion.

 James
Thanks James, mixing re[porting systems

mlmcc
Avatar of PresidentLincoln

ASKER

Thanks for the help guys.  This is what I needed.
You're welcome.  Glad I could help.

 James