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

Use Null in SQL

Status
Not open for further replies.

tpoettker

Programmer
Jan 4, 2002
41
US
I have a stored procedure with the following sql statement:

GreaterExpenses = Case When expenses.reserve_amount > (Expenses.paid_total - Expenses.collection_total) Then Expenses.reserve_amount else (Expenses.paid_total - Expenses.Collection_total) End

This statement is not working because Expenses.paid_total and/or Expenses.collection_total and/or Expenses.Reserve_amount is null.

Any suggestions?

 
Have a look at COALESCE

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top