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

Subreports in Crystal Reports 9

Status
Not open for further replies.

donnarenia

Technical User
May 28, 2010
41
US
I am using this formula to get a dollar amount if the Cash type equal "A" (for Adjustment) and if it does equal adjustment I need it to Subtract the Cash.Amount from the Final Bill amount BUT if it equals "P" (for payment) I want it to just show the final bill amount

My Formula:
if {CASH.Type} = "A"
then {CASH.Amount}={AR.FinalBillAmt}-{CASH.Amount}and
if {CASH.Type}="P" then {CASH.Amount}= {AR.FinalBillAmt}

But when i put it in my report, it shows "FALSE" what can I be doing wrong
 
You have to use ":=" for assignment statements. I have done this way too many times.

if {CASH.Type} = "A" then {CASH.Amount}:={AR.FinalBillAmt}-{CASH.Amount}and
if {CASH.Type}="P" then {CASH.Amount}:= {AR.FinalBillAmt}
 
Great....I entered your formula but receive the following error message:

the remaining text does not appear to be part of the formula

 
I did not notice the 'And' between the if statements. Probably should an 'else'.

if {CASH.Type} = "A" then {CASH.Amount}:={AR.FinalBillAmt}-{CASH.Amount} else
if {CASH.Type}="P" then {CASH.Amount}:= {AR.FinalBillAmt}

Now if {CASH.Type} is neither "A" or "P" then nothing will be returned.
 
if {CASH.Type} = "A" then
{AR.FinalBillAmt}-{CASH.Amount} else
if {CASH.Type} = "P" then
{AR.FinalBillAmt}

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top