Skip to Content
0
Former Member
Sep 12, 2011 at 05:41 PM

Goods Issue - SQL Query will not sum

127 Views

I have 3 Goods Issue documents with Document Total for each document 10,000 / 20,000 / 30,000 subsequently.

I want to make query so that it will display like below - where it shows BOTH each of 3 document value (10000/2000/30000) AND the sum of the 3 documents (60000) like below.

Doc 1 - 10,000

Doc 2 - 20,000

Doc 3 - 30,000

-


Total = 60,000

-


In addition, I would like the ability to choose date range. Basically, something like

SELECT Document_Total

FROM Goods_Issue table

WHERE the_document_date is between 1-SEP-2011 and 31-SEP-2011

AND the_reference_is _________________

I have tried many SQL queries, but it displayed either:

Doc 1 - 10,000

Doc 2 - 20,000

Doc 3 - 30,000

OR

Total = 60,000

Please help.