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

when using formula "if is null" sometimes works sometimes doesnt

Status
Not open for further replies.

jizzycrystal

IS-IT--Management
Joined
Nov 10, 2007
Messages
65
Location
IE
if IsNull ({@period_amt}) then '0.00'
some fields I get 0.00 and other times just blank
 
well, you must specify what to do if not null:

if IsNull ({@period_amt}) then
'0.00'
else
{@period_amt}
 
what if the field was filled in and then deleted? It would no longer be null but would also be blank

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"Whoever battles with monsters had better see that it does not turn him into a monster. And if you gaze long into an abyss, the abyss will gaze back into you. ~ Nietzsche"
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
If the field would be deleted and not null, but simply empty, adjust the formula to
Code:
if (IsNull ({@period_amt}) or trim({@period_amt})='') then 
  '0.00'
else
  {@period_amt}
That should do
 
Actually both the then and else values must be of the same data type. I somehow doubt that {@Period_amt} is a string.

Please post the formula for {@period_amt} so this question can be answered.

Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports

"What version of URGENT!!! are you using?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top