Although this statement returns the correct numbers to the report to be completed, Is there a better way to state this statement?
where total_b is the total sale
s4130 and ototal are the taxable items on a contract
the rate of tax is 5%
the discount for prompt payment is 2%
thanks,
wjwjr
where total_b is the total sale
s4130 and ototal are the taxable items on a contract
the rate of tax is 5%
the discount for prompt payment is 2%
Code:
CREATE TABLE test2.dbf (total_b n(10 ,2), s4130 n(10,2), ototal n(10,2))
INSERT INTO test2.dbf (total_b, s4130, ototal) values(1000.00, 500.00, 100.00)
INSERT INTO test2.dbf (total_b, s4130, ototal) values(1000.00, 500.00, 100.00)
INSERT INTO test2.dbf (total_b, s4130, ototal) values(1000.00, 500.00, 100.00)
SELECT ;
ROUND(SUM(TOTAL_B),2) AS TOTALSALES, ;
ROUND(SUM(S4130) + SUM(OTOTAL),2) AS TAXABLESALES, ;
ROUND((SUM(TOTAL_B))-(SUM(S4130)+SUM(OTOTAL)),2) AS DEDUCTION, ;
ROUND((SUM(S4130)+SUM(OTOTAL))*(.05),2) AS TAXAMOUNT, ;
ROUND(((SUM(S4130)+SUM(OTOTAL))*(.05))*(.02),2) AS TAXDISCOUNT, ;
ROUND((((SUM(S4130)+SUM(OTOTAL))*(.05))-(((SUM(S4130)+SUM(OTOTAL))*(.05))*(.02))),2) AS TAXDUE ;
FROM TEST2
thanks,
wjwjr