I have a Price table and a Discount table, currently I am using this to calculate the Net price between the two:
RS_PCL.Price-RS_DISC.[Disc Amt] AS Net
However, I do a Left join from the PCL table to the Discount table because there are certain items which don't have discounts. Is it possible to make this field also include the normal Price if the Discount amount is null?
(Currently, if the discount amount is null, it just leaves Net blank/null, I'd like to include the price with no discount removed)
CodePudding user response:
You can use Nz:
RS_PCL.Price-Nz(RS_DISC.[Disc Amt],0) AS Net