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!

Formula error

Status
Not open for further replies.
Sep 16, 2005
191
US
When I ran my report with this formula, it display "TRUE".

"Total Input into App" Formula: {TB_DAILY.ACTIVITY_DATE} >= {?StartDate}
and {TB_DAILY.ACTIVITY_DATE} <={?EndDate}

?Start Date and ?End Date is a parameter that I created. It is only used in the "Total" field. Not in the selection formula.

Is something wrong with my formula? My report suppose to pull in all the data and then filter within the report the count of "Total Input into App" base on the {?StartDate} and {?EndDate}
 
You could modify your formula to be something like this:
If {TB_DAILY.ACTIVITY_DATE} in {?StartDate} to {?EndDate} then 1 else 0

Then insert a Sum on this formula.


Bob Suruncle
 
What you've written is a 'boolian', a formula that can be added to a detail line, or tested at that level. If you put it om the report footer in the hope it will give you a total, all you get is the result for the last record.

If you used it the 'Evaluate' formula of a Running Total, it definitely ought to work.

The method recomended by BobSuruncle would also work, but there are extra tricks possible with Running Totals, once you get used to them. (Worth writing an experimental report just to learn.)

Right-click on a field and choose Insert to get a choice of Running Total or Summary. Or else use the Field Explorer, the icon that is a grid-like box, to add running totals.

Running totals allow you to do clever things with grouping and formulas. They also accumulate for each line, hence the name. The disadvantage is that they are working out at the same time as the Crystal report formats the line. You cannot test for their values until after the details have been printed. You can show them in the group footer but not the group header, where they will be zero if you are resetting them for each group.

Summary totals are cruder, but are based directly on the data. This means that they can be shown in the header. They can also be used to sort groups, or to suppress them. Suppress a group if it has less than three members, say. They default to 'Grand Total', but also can be for a group.


[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top