title: To make 0 if the value is null in sql server
body: <p>In the below query i am select  the product with currentstock .Now i want to replace 0 if the currrent stock is null.Pls help me to do this.</p>
  
  <pre><code>SELECT   p.ProductID,
         p.ProductName,
         (SELECT ISNULL( CurrentStock,0.00) 
          FROM   Productstatus PS
          WHERE  PS.ProductID =p.ProductID
                 AND PS.LocationID = 1
                 AND PS.StatusDateTime= '2014-08-27'
                 and PS.productid=p.productid) CurrentStock
  FROM   Product P
  LEFT OUTER JOIN LocationProductMap LMP ON LMP.ProductID=P.ProductID
  WHERE LMP.ProductInFlow=1
  </code></pre>