I have the following SQL statement... the two subselect statements can return NULL values. Because I use the subselect results in a calculation, I need for the result to be 0 instead of NULL.
How do I do that?
How do I do that?
Code:
-- Calculate Kit Available Qty based on component with lowest qty available select ifcom#, ifprt#, ifprt2, ifqty#, ieqoh#, (ieqoh# - (select sum(odctt#) from oeordlod where odcom#=ifcom# and odprt#=ifprt2 and odwhs#='MLP') - (select sum(odalc#) from oeordlod where odcom#=ifcom# and odprt#=ifprt2 and odwhs#='MLP') - ieqrs#)/ifqty# as avail from oebilmif join icbalmie on iecom#=ifcom# and ieprt# = ifprt2 and iewhs#='MLP' where ifcom#='027' and ifprt#='01024771519' order by avail asc fetch first row only;
Comment