Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to do summary 1

Status
Not open for further replies.

satyakumar

Programmer
Jun 29, 2008
44
US
Hello Tech People,

I have a small Question...

I am getting data from database as like this to the crystal reports...

NBR Name Amount Date
1 ABC 3000.00 01/01/11
1 ABC 3000.00 03/01/11
1 ABC 3000.00 02/01/11
2 DEF 4000.00 04/01/11
2 DEF 4000.00 05/01/11
2 DEF 4000.00 03/01/11
3 GHI 3000.00 01/01/11
3 GHI 3000.00 02/01/11
3 GHI 3000.00 03/01/11
---------
30,000.00
----------
In the Crystal reports the Users want to see data like this


NBR Name Amount Date
1 ABC 3000.00 03/01/11
2 DEF 4000.00 05/01/11
3 GHI 3000.00 03/01/11
---------
10,000.00
---------

So they dont want to see the Duplicate data Each month thats rolling.

What i have done is: in the detail section i wrote a supress formulae --- {date} <> maximum{date}

So its working good. But i am not able to do the Summary.
How do i do the summary to get the 10,000 amount as i described in the example.

Appreciate your help.....





 
satyakumar,

I assume you have a report structure like:
[tt]Group 1: Table.Name
- Details[/tt]
and the suppression Criteria is actually:
Code:
{Table.Date} <> Maximum({Table.Date},{Table.Name})


Assuming the above, your solution can be found by implementing the following formulae. (though may be able to be done with a #RunningTotal field as well)

{@Formula1} (Place in Report Header)
Code:
WhilePrintingRecords;
NumberVar Total:=0;
*Reset / Set the Variable to Zero (0).

{@Formula2} (Place in Details)
Code:
WhilePrintingRecords;
NumberVar Total;

IF {Table.Date} = Maximum({Table.Date},{Table.Name}) THEN Total:=Total+{Table.Amount};
*This formula conditionally increments the variable "Total".


{@Formula3} (Place in Report Footer)
Code:
WhilePrintingRecords;
NumberVar Total;
*Displays the result

Hope this helps!

Mike
---------------------------------------------------------------
"To be alive is to revel in the moments, in the sunrise and the sunset, in the sudden and brief episodes of love and adventure,
in the hours of companionship. It is, most of all, to never be paralyzed by your fears of a future that no one can foretell."
 
That worked very well MCuthill. I appreciate very much in helping.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top