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

Formula Help 1

Status
Not open for further replies.

Senseial

Programmer
Feb 11, 2004
40
CA
Hello

I am kind a new to Crystal Reports and need help here.
This is what I have to do. I have 2 columsn Qup & QDown
Eg:

Qup Qdown Total
600 0 600
200 400
150 350
100 250
50 200
25 175
10 165

Qup and Qdown is really one field where I sort on that field descending. If that first row is 600 go ahead and display it. on the second row don't display first field anymore but display it in the second formula field.

Thanks a lot
 
Create two formulas:

//{@Qup}:
if onfirstrecord then {table.amount} else 0

//{@Qdown}:
if not onfirstrecord then {table.amount}

Right click on {@Qup} and choose format field->number->customize->suppress if zero.

For your total formula, you could use:

//{@Total}:
whileprintingrecords;
numbervar total;

if onfirstrecord then total := {table.amount} else
total := total - {table.amount};

Substitute the name for your field for {table.amount} in the formulas above.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top