The sum is performed in a cursor before the printing on the report
here is an example:
PREPARE p_sum2 FROM
"SELECT SUM(receivable) FROM temp_open1 \
WHERE branch = ? AND repnum = ? \
AND MONTH(selectdate) = MONTH(TODAY) - 1 \
AND YEAR(selectdate) = ...
I have to create a sales report using current quarter totals and previous quarter totals. What is a simple of way breaking down the months in quarters and query on a sum for example invested amount?
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.