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

x
?
Solved

add a summarized field without totaling by group...

Posted on 2003-12-09
7
Medium Priority
?
289 Views
Last Modified: 2012-05-04
This is probably a simple one...or not.

Using Crystal Reports 8.5, I'm running a query from an Informix database.  The query consists of
period
billing attorney
timekeeper
client number
invoice number
worked hours

and some others.  The result should be for each period there will be an invoice.  That invoice will have a dollar amount with multiple worked hour entries for each timekeeper.  I want the report to sum the worked hours by timekeeper-clientnumber-invoice-period.

If I run this query right out of Informix (dbaccess)  I can select distinct records and sum the worked hours in that fashion.  If I try this in Crystal, (summing worked hours), it will sum all worked hours for all timekeepers.

Basically if Joe had two time entries in January (5 hours and 2 hours) for client XYZ, I want the query to sum his hours (7 hours) and not include Nancy who had one time entrie of 2 hours for the same month and client.

Here is a copy of the query (not from Crystal)

SELECT DISTINCT
      period_yymm.p_yymm,
      matter.mbillaty,
      timecard.ttk,
      ledgfee.lfcode,
      timecard.tinvoice,
      ledgfee.lfamnt,
      timecard.tmatter,
      matter.mprac,
      matter.mdept,
      Sum(timecard.tworkhrs),
      timekeep.tkstdcst
FROM
      elite.ledger ledger,
      elite.ledgfee ledgfee,
      elite.matter matter,
      elite1.period_yymm period_yymm,
      elite.timecard timecard,
      elite.timekeep timekeep
WHERE
      timecard.tinvoice = ledger.linvoice AND
      timecard.tmatter = matter.mmatter AND
      timecard.ttk = timekeep.tkinit AND
      ledger.lindex = ledgfee.lindex AND
      period_yymm.pe = ledger.lperiod AND
      ((period_yymm.p_yymm>= pd_start And
      period_yymm.p_yymm <= pd_end) AND
      (ledger.llcode In ('PAY','PAY-LEG','WOFF')) AND
      (ledgfee.lfindex Not In (1776,1777,1778,1779,1780,1781)))
GROUP BY
      period_yymm.p_yymm,
      matter.mbillaty,
      timecard.ttk,
      ledgfee.lfcode,
      timecard.tinvoice,
      ledgfee.lfamnt,
      timecard.tmatter,
      matter.mprac,
      matter.mdept,
      timekeep.tkstdcst


Hopefully this makes sense to you.  Thank you.
0
Comment
Question by:AConover
  • 3
  • 2
7 Comments
 
LVL 101

Expert Comment

by:mlmcc
ID: 9906366
In Crystal you can use RUNNING TOTALS to do what you want.

In the report group the data as you want it, then create the running totals

Open the FIELD SELECTOR
Select RUNNING TOTAL
Right click --> Select NEW
Give it a name
Select the field - timecard.tworkhrs
Type  - SUM
Reset - On Group Change
Evaluate - For each record

Put the running total in the group footer

You can eliminate the groups and the sum field in the query, the raw data is passed in.
Add groups in Crystal

mlmcc
0
 
LVL 1

Author Comment

by:AConover
ID: 9906441
Wow, wasn't aware of that feature.  
Ok, I don't have any groups set up, just raw detail.
0
 
LVL 1

Author Comment

by:AConover
ID: 9906626
Here's an example of the returned data.  These are all raw time entries.  TWorkhrs is summarized by timekeeper.  The 2.6 hours for FLB (ttk) is actually 3 separate entries totaling 2.6.  

p_yymm      mbillaty      ttk      lfcode      tinvoice      lfamnt      tmatter                   mprac       mdept  sum of tworkhrs
0301      FLB      FLB      PAY      23482      867.5      AE100-00122      550      20      2.6
0301      FLB      JWS      PAY      23482      867.5      AE100-00122      550      20      0.5
0301      FLB      LRM      PAY      23482      867.5      AE100-00122      550      20      0.2
0301      FLB      FLB      PAY      23483      825      AE100-02385      540      20      3
0
 
LVL 1

Author Comment

by:AConover
ID: 9907077
I'm not sure how to group the data, since I need all the raw data returned.  Any ideas?
0
 
LVL 101

Accepted Solution

by:
mlmcc earned 400 total points
ID: 9917479
Open the report
Click INSERT --> INSERT GROUP
Select the field you want as the master group
   I think you want  -  timekeeper
Repeat for the other groups
       clientnumber
       invoice-period

mlmcc
0

Featured Post

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

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

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
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. …

926 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question