Skip to Content
0
Former Member
Jul 04, 2012 at 07:51 AM

The query result show wrong numbers

10 Views

Dear All,

Kindly help to correct the query below. I Have return query for Sock transfer with outexcise invoice tax value.

SELECT

T0.[DocNum], T3.Docnum,T0.[CardCode], T0.[CardName], T0.[DocDate], T0.[DocTotal],



sum

(CASE when t2.StaCode = 'ED@6' Then (T2.taxsum) Else 0 END)[ED6%on Ass value],


sum

(CASE when t2.StaCode = 'ED@6_M' Then (T2.taxsum)Else 0 END)[ED6%on MRP value],


sum

(CASE when t2.StaCode = 'ED@12' Then (T2.taxsum) Else 0 END)[ED12%on Ass value],


sum

(CASE when t2.StaCode = 'ED@12_M' Then (T2.taxsum) Else 0 END)[ED12%on MRP value],


sum

(CASE when t2.StaCode = 'Cess_ED' Then (T2.taxsum) Else 0 END)[EDU_Cess],


sum

(CASE when t2.StaCode = 'HSC_ED' Then (T2.taxsum) Else 0 END)[HS_Cess]


FROM

OWTR T0 INNER JOIN WTR1 T1 ON T0.DocEntry = T1.DocEntry


INNER

Join OEI1 A ON T0.Docentry = A.BaseEntry


Inner

Join OEI4 T2 ON A.DocEntry = T2.Docentry


Inner

Join OOEI T3 ON T3.DocEntry = A.Docentry


WHERE

T0.[SeqCode] = '1' and T3.Filler is not null


group

by T0.[DocNum], T0.[CardCode], T0.[CardName], T0.[DocDate], T0.[DocTotal],T3.Docnum

thank you

sridharan