I am trying to further narrow down an expression in a view. Below is the expression:
dbo.Payments.AmountPaid - (dbo.InvoiceDetails.Usage * dbo.InvoiceDetails.Price + ISNULL((dbo.InvoiceDetails.TRate / 100) * (dbo.InvoiceDetails.Price * dbo.InvoiceDetails.Usage), 0))
I want to take the above expression and make the outcome 0 if AmountPaid is 0.
Only when there is an amoutpaid is when I want to see the value else 0.