cancel
Showing results for 
Search instead for 
Did you mean: 

Reg: Query clarification

former_member237214
Participant
0 Kudos

Dear All,

Am making a query to get  sales value, I have combined  OINV and INV1 table and I put sum(LineTotal) I got one value,

In same query if i combine INV4, am getting different value.. 

Could anyone help me to resolve this issue..

I have attached screenshot for your reference..

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

This is an german forum.

Anyway: join the inv4 with LEFT JOIN, because not every invoice has rows in it.

hth

Former Member
0 Kudos

Hello Logesan,

you have more than 1 row in the table inv4 in conjunction with the row in the table oinv.

i think you musst change your sql-query to this:


select sum(t1.LineTotal) 'Net Value'

from oinv t0

inner join inv1 t1 on t0.DocEntry = t1.docentry

inner join inv12 t2 on t0.DocEntry = t2.DocEntry

inner join inv4 t3 on t0.DocEntry = t3.DocEntry

where t0.DocDate between '2016-04-01' and '2016-04-30'

group by t0.docentry, t1.DocEntry, t2.DocEntry, t3.DocEntry, t0.DocDate

Best Regards

Ronny