As part of a much larger query, I am attempting to add the value of two columns of type money. Depending on the rest of the query, the values in either column can be NULL, or a single column can be NULL, or both columns can contain money values.What I am trying to avoid is a result of NULL when either TSNI or TI has values, but when I run the query on actual data I get results similar to below:TSNI Value TI Value Result---------- -------- ------5.00 10.00 15.00NULL 10.00 NULL5.00 NULL NULL
Would anyone have any ideas to point me in the right direction?CASE subTSNI.TotalShippedNotInvoiced WHEN NULL THEN (CASE subTI.TotalInvoiced WHEN NULL THEN 0 ELSE (SELECT subTI.TotalInvoiced) END) ELSE (CASE subTI.TotalInvoiced WHEN NULL THEN (SELECT subTSNI.TotalShippedNotInvoiced) ELSE (SELECT subTI.TotalInvoiced + subTSNI.TotalShippedNotInvoiced) END)END AS TOTAL_SHIPPED,