Creating running totals using a formula:<br>If you have suppressed data, or your data is based on a formula that occurs WhilePrintingRecords, you should create a running total formula rather than using the Running Total Select Expert.<br><br>When you create a running total manually, you need to create three formulas:<br><br>a summary formula <br>a reset formula to set a variable to zero <br>a display formula to display the variable. <br><br>The reset formula typically goes in a group header, and is typically formatted to suppress printing.<br>The display formula typically goes in the corresponding group footer.<br>The summary formula calculates the value, depending on the criteria. Usually this formula is suppressed as well.<br><br>Calculating a distinct count for work orders is easiest if the data is grouped by work order. Then, just put the summary formula in the group header for work orders. <br>//SummaryFormula<br>NumberVar CountWorkOrdersMonth ;<br>NumberVar CountWorkOrdersTotal ;<br>CountWorkOrdersMonth := CountWorkOrdersMonth + 1 ;<br>CountWorkOrdersTotal := CountWorkOrdersTotal + 1 ;<br><br>//Reset formula in group header<br>NumberVar CountWorkOrdersMonth := 0 ;<br><br>//Display formula in group footer<br>WhilePrintingRecords ;<br>NumberVar CountWorkOrdersMonth ;<br><br>//Display formula in report summary<br>WhilePrintingRecords ;<br>NumberVar CountWorkOrdersTotal ;<br><br>Note that if you have the same work order in two months, it will be counted twice in the Total. If this is a problem, you will have to use a subreport placed in the report footer, that has an outside group of work orders to get the distinct count<br><br><br> <p>Malcolm Wynden<br><a href=mailto:wynden@island.dot.net>wynden@island.dot.net</a><br><a href= > </a><br>