Here is my SQL:
-- Order information
SELECT ISNULL(p.PaymentAmt, 0) AS PaymentAmt, o.TaxAmt, o.PostAmount, o.OrderDate, o.PublicNotes, u.userid, PostAmount + TaxAmt AS Total, PostAmount - PaymentAmt AS Due
FROM Orders o
INNER JOIN Payment p ON p.OrderID = o.OrderID
INNER JOIN Users u ON o.EnteredBy = u.UserKey
Where o.OrderID = 5267
Right now for this specific OrderID it returns 0 rows just the column headers. Is there a way to force this to return 0’s for the value and empty strings for the rest?
I think it should give you desired results :