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

replacing null with 0 currency in the formula

Status
Not open for further replies.

gagani

Programmer
Nov 20, 2011
57
GB
table1
orderid
listprice

table2
orderid
listprice

i am left joining table1 with table2 as table2 doesnot
have all the orderids.

i need a formula which adds both the listprices

{table1.listprice}+{table2.listprice} is not giving me
any values as table2 does not have all the orderids as
table1.

how to prevent this?
I tried

@formula1
if isnull({table2.LISTPRICE}) then "0"

@formula2 = table1.listprice+@formula1

but table1 list price is a currency and is not allowing
me make @formula

could anyone help me with this adding currency value of
0 to the table1 when there is no existence of orderid
in table2
 
It would not be if isnull({table2.LISTPRICE}) then "0", it would be if isnull({table2.LISTPRICE}) then 0 else {table2.LISTPRICE} . You could also put that all into @forumula 2. @formula2 = table1.listprice+(if isnull({table2.LISTPRICE}) then 0 else {table2.LISTPRICE})

I hope this helps.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top