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!

previous function

Status
Not open for further replies.

Luvsql

Technical User
Apr 3, 2003
1,179
CA
I have a formula:

if {table.field}=Previous({table.field}) then 0
else {@Amount}

It works great except the first value is always blank, even with the convert nulls to default. Is there any reason why the formula doesn't work if the previous value is null or doesn't exist?
 
Try:

if previousisnull({table.field}) then {@Amount} else
if {table.field} = Previous({table.field}) then 0
else {@Amount}

This will give you the amount value for the first record or on change of {table.field}. You could also use:

if onfirstrecord then {@Amount} else
if {table.field} = Previous({table.field}) then 0
else {@Amount}

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top