cancel
Showing results for 
Search instead for 
Did you mean: 

Total value In query

Former Member
0 Kudos

Hi,

I have this query

SELECT T0.DocNum, T0.DocType, T0.CardCode, T0.CardName, T0.DocTotal, T0.Footer FROM OINV T0

In end of the DocTotal column i need total of document total

how to do it

Regards

srinivas

Accepted Solutions (1)

Accepted Solutions (1)

former_member204969
Active Contributor
0 Kudos

You probably want something like this:

SELECT T0.DocNum, T0.DocType, T0.CardCode, 
T0.CardName, T0.DocTotal, T0.Footer 
FROM OINV T0 
Union all 
Select 0,'','','',sum(t.doctotal),'' FROM OINV T

keith_taylor2
Active Contributor
0 Kudos

This is great - can you also name the total field 'Total'

former_member204969
Active Contributor
0 Kudos
SELECT T0.DocNum, T0.DocType, T0.CardCode,
 T0.CardName, T0.DocTotal, T0.Footer 
FROM OINV T0 
Union all
Select 0,'','','Total:',sum(t.doctotal),'' From OINV t 

Answers (3)

Answers (3)

former_member203638
Active Contributor
0 Kudos

In order to get the amount for a range of time I did so, but I do not correct the amounts:

SELECT T0.DocNum, T0.DocType, T0.CardCode,

T0.CardName, T0.DocTotal, T0.Footer

FROM OINV T0 where t0.docdate between [%1] and [%2]

Union all

Select 0,'','','Total:',sum(t.doctotal),'' From OINV t

I would like to validate that are not converted to notes of credit. Any idea?

Best regards

former_member204969
Active Contributor
0 Kudos

It is a closed thread, you should open a new one for the new problem.

keith_taylor2
Active Contributor
0 Kudos

Thank you so very much - This is something I wanted to do for over two years and was told it was impossible.

Former Member
0 Kudos

Hi

I think you may not achieve it through query. But you can get total in the query result window, by holding right mouse button and click on the column header.

Thanks

Anjan Bhowmick

New-Age Business Consultants

Bangalore, India