1) The following SQL statement is working
SELECT
SUM(sales.TotalAmount) AS the_sum_Total
FROM
sales
WHERE
LEFT(sales.InvDate ,6) = {paramMonth}
2) But the moment i need to deduct the discount amount from Total Amount, the_sum_total will return NULL
SELECT
SUM((sales.TotalAmount - sales.DiscountAmount)) AS the_sum_Total
FROM
sales
WHERE
LEFT(sales.InvDate ,6) = {paramMonth}
Is there a bug in the SQL query where i cannot deduct within the SUM?
Regards,
Jon Lau