Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Need help writing a formula Post Reply Post New Topic
Author Message
BusyAnalyst
Newbie
Newbie


Joined: 01 Feb 2008
Online Status: Offline
Posts: 3
Quote BusyAnalyst Replybullet Topic: Need help writing a formula
     Posted: 01 Feb 2008 at 1:34pm

Can a textbox be used for formulas? If it can, I need assistance in writing a code that will display the count of a field. Example: I have a table called ServiceEntity with a field called LaborRate {ServiceEntity.LaborRate}. This field has numerous labor rates, however in the GH2 (Group Footer 2) I want a textbox to show the count of  {ServiceEntity.LaborRate} that falls in the range of $0.00 to $29.99. It does not have to be a textbox. If something else works, I can use that too.

IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 03 Feb 2008 at 11:03am

You can do this a couple of ways.  The easiest is going to be to use a running total.

1.  Create a new running total in the Field Explorer
2.  Type of Summary is Count.  Field to summarize can be any field in the table - for this type of count, I usually use a unique identifier like an Identity (MS-SQL) or Sequence (Oracle) field.
3.  Evaluate - Use Formula.  Click on the Formula button and enter:
 
{ServiceEntity.LaborRate} > = 0 and {ServiceEntity.LaborRate} < 30
 
4.  Reset on Change of Group - select your Group 2.
 
Put this running total in your Group 2 footer to display your count.
 
-Dell
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum