Skip to Content
avatar image
Former Member

HSN code wise consolidated report

Hi,

Using the below query i am trying to fetch HSN code(ChapterID) wise consolidated sales report , But the line items are repeating.

Select D.ChapterID 'HSN Code',b.Dscription 'Item Description',b.UomCode 'UOM', sum(b.Quantity) 'Quantity' ,Sum(b.LineTotal) 'Total Value',sum(b.PriceBefDi * b.Quantity ) 'Total Taxable Value', case when E.staType ='-100' then SUM (E.TaxSum) else 0 end 'CGST Amount', case when E.staType ='-110' then SUM (E.TaxSum) else 0 end 'SGST Amount', case when E.staType ='-120' then SUM (E.TaxSum) else 0 end 'IGST Amount' from OINV A join INV1 B on A.DocEntry =b.DocEntry left join INV4 E on E.DocEntry =A.DocEntry left join OITM C on B.ItemCode =C .ItemCode left join OCHP D on D.AbsEntry =c.ChapterID group by D.ChapterID ,b.Dscription,b.UomCode,E.staType

Rgds,

Krishna

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • avatar image
    Former Member
    Nov 06, 2017 at 02:34 PM

    i have same Problem i have make crystal report data will be ok but no in sql.

    Add comment
    10|10000 characters needed characters exceeded