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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Record Selection Based on Manual Running Total

Status
Not open for further replies.

tman135

Programmer
Feb 28, 2001
48
US
I've got a report that uses a manual running total to determine distinct transfers of a ticket from group to group. I need to limit the report to transfers greater than 3? Is ther a way to use a manual running total in your record selection formula?

 
Hi!
The only way that I can think of doing this (and it isn't ideal!) is to create a subreport.

I would do it in these steps:

1. create a subreport and put all the fields that you have in your main report inside it so that you have duplicated the report.
2. Pass the running-total total from the subreport to the main report.
3. Put the running-total total in a formula (make it a variable field)
4. Put this figure in the Main report Header.
5. Put this in the Selection criteria of the main report (ie {running_total_1} > 3 for example.
6. Link the subreports via the natural fields
7. run the report.

Before you do anything at all - back this report up so that you are working with a copy - then play around with the idea. I have had to do this for several financial reports so I know that it is possible (it is just not a very nice way of doing things!)
Shout if you need any more help.

Good luck!
Justine
 
Dear Tman,

The answer to your question is no you can't use a running total in your selection criteria.

The ideal place to do this would be with a field in the database that holds this count. Show some data, maybe there are other options.

ro Rosemary Lieberman
rosemary@microflo.com, Microflo provides expert consulting on MagicTSD and Crystal Reports.
 
Thanks for the input, I ended up reformatting the report to show the necessary data in Group Footers and use a subreport up top to return a shared variable containing the value I need to filter on. Then I'm just suppressing records based on that criteria.
I would tend to agree the best approach would be to have some criteria directly from the db. Unfortunately, I don't have access to write stored procs and the SQL is a bit more complicated than i could get working in a single source statemet for Crystal.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top