Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 9730

Re: Consumption Report item wise(Columnar Report)

$
0
0

Hi,

 

Try this report:

 

SELECT [custcode] as Custcode, isnull([1],0) as Jan, isnull([2],0) as Feb, isnull([3],0) as Mar, isnull([4],0) as Apr,  isnull([5],0) as May, isnull([6],0) as june, isnull([7],0) as July, isnull([8],0) as Aug, isnull([9],0) as Sept, isnull([10],0) as Oct, isnull([11],0) as Nov, isnull([12],0) as Dec

From
(select T0.[CardCode] as Custcode, sum(T1.[IssuedQty]) as ConsQty, month(T0.[DueDate]) as Month

from dbo.OWOR T0 inner join WOR1 t1 on T0.DocEntry = T1.DocEntry where T0.[Status]  IN ( 'R','L' ) and T0.[CardCode] between [%0] and [%1]  and year(T0.[DueDate]) =2013 group by T0.[CardCode],T0.[DueDate]  )s

Pivot
(sum(Consqty) for month IN ([1],[2],[3],[4],[5],[6],[7],[8],[9],[10],[11],[12])) P order by [custcode]

 

Hope helpful.

 

Thanks & Regards,

Nagarajan


Viewing all articles
Browse latest Browse all 9730


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>