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

cumulative total from one date to a

Status
Not open for further replies.

kalpsv

Programmer
Jun 12, 2002
58
IN
cumulative total from one date to another


I have a field called subscription. I want to total
that field from a date say 31.03.2002 till yesterday
i.e. 28.12.2002. I am getting this value incluidng
today i.e 31.03.2002 till 29.12.2002 I used this formula

IF MAXIMUM ({PPFTXN.VOUCHDT}) in date(2002,03,31) TO
date(YEAR(MAXIMUM({PPFTXN.VOUCHDT})),month(MAXIMUM({PPFTXN.VOUCHDT})),01)-1 THEN
0 ELSE
({@subs});

@ subs is the subscription field which is just checking
for null value in case there is a null value.
i am struck at this point.
Can you help me
Thank you in advance
and wish you all a VERY HAPPY AND PROSPEROUS 2003.

BYE
 
Where is this formula placed in your report? Why the maximum() statement?

If this is a detail report, then the Maximum() is useless as it will get the maximum for that ONE RECORD, which can have only one value anyway.

Also, your formula looks like you are assigning a vlaue of zero if the date falls within that range. Is this what you want?

More detail please. Software Sales, Training and Support for Macola, Crystal Reports and Goldmine
dgilsdorf@mchsi.com
 
Consider limiting the report to only those rows using the record selection formula:

(
{PPFTXN.VOUCHDT}) >= date(2002,03,31)
and
{PPFTXN.VOUCHDT}) <= currentdate-1
)

Keep in mind that a date compared to a datetime can result in unexpected results using Crystal, so if you're comparing to a datetime, so specify.

This will optimize row selection from the database, and improve performance.

Another setting:

File->Report Options->Convert Null Field Value to Default

will change nulls to their default value (null becomes a 0, or null becomes &quot;&quot;, etc)

If you don't want to limit the rows in the report, use a Running Total field with the same formula as described for the record selection formula above in the Evaluate->Use a Formula.

-k kai@informeddatadecisions.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top