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

Crystal IF STATMENT for NEGATIVE VALUES!!!! PLS HELP HELP!!!!!! 1

Status
Not open for further replies.

sommererdbeere

Programmer
Nov 20, 2003
112
US
Hi,

This is a strange question that i cannot figure out why. I have an if statement where i want to pull all the "NEGATIVE" values to this column, but it doesn't work which i don't know what have i done wrong. I hope all the experts here can help me.

CR 8.5
Oracle 8.0

database:
ID Account Amount
2345 2590 -3000
2345 1230 3000

crystal statement:
formular: CR
if {amt} = - {amt} then
{account}


formular: DR
if {amt} <> - {amt} then
{account}


NOTE: {amt} is number and {account}is string
output:
ID Amount($) CR DR
2345 -3000 2590
2345 3000 1230

i don't know what's wrong with my crystal statement and please please which i hopw all of you can help me. I need to turn this report in by the end of today.

million thanks..

m
 
Try:

formular: CR
if {amt} < 0 then
{account}

formular: DR
if {amt} >= 0 then
{account}

-k
 
The problem is with your formulas. For example, for CR:

if {amt} = - {amt} then {account}

Since the amont will never be equal to the negative of the amont (unless the value is zero) this formula will always evaluate to false, and the value of {account} will not be assigned.

I would use SV's approach here.

Software Sales, Training, Implementation and Support for Exact Macola, eSynergy, and Crystal Reports
 
thanks to both ynapsevampire and dgillz ..

i am soo stupid that i cannot realize the fact that i can have it set as < or > 0

thanks to both.. appreciate very much.. thank you thank you

m :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top