﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / SQL Server 2008 / T-SQL (SS2K8)  / pivot table subtotal / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Sun, 19 May 2013 01:36:34 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: pivot table subtotal</title><link>http://www.sqlservercentral.com/Forums/Topic1217780-392-1.aspx</link><description>PIVOT is probably not the right tool for the job, because it doesn't provide grand totals.  The correct tool depends on exactly how you are using this data.  If you are simply creating a report, then some sort of reporting software, such as SSRS, is the correct tool.Drew</description><pubDate>Wed, 07 Dec 2011 07:49:53 GMT</pubDate><dc:creator>drew.allen</dc:creator></item><item><title>pivot table subtotal</title><link>http://www.sqlservercentral.com/Forums/Topic1217780-392-1.aspx</link><description>hello ,how subtotal from pivot table my scrip ;select[HESAP KODU],[HESAP ADI],ISNULL(Ocak,0) as Ocak,ISNULL(Subat,0) as Subat,ISNULL(Mart,0)as Mart,ISNULL(Nisan,0)as Nisan,ISNULL(Mayis,0)as Mayis,ISNULL(Haziran,0)as Haziran,ISNULL(Temmuz,0)as Temmuz,ISNULL(Agustos,0)as Agustos,ISNULL(Eylul,0)as Eylul,ISNULL(Ekim,0)as Ekim,ISNULL(Kasim,0)as Kasim,ISNULL(Aral,0)as Aralfrom(SELECT M.CODE AS [HESAP KODU],M.DESCRIPTION AS [HESAP ADI], (ISNULL(ROUND(L.DEBIT-L.CREDIT,2),0)) AS [TOPLAM], case L.TOTMONTH when 1 then 'Ocak'when 2 then 'Subat'when 3 then 'Mart'when 4 then 'Nisan'when 5 then 'Mayis'when 6 then 'Haziran'when 7 then 'Temmuz'when 8 then 'Agustos'when 9 then 'Eylul'when 10 then 'Ekim'when 11 then 'Kasim'when 12 then 'Aral'end as [AY]FROM U_001_01_GLACCMONTOTS L WITH(NOLOCK)JOINU_001_GLACCOUNTS M WITH(NOLOCK)ON M.LOGICALREF=L.GLACCOUNTREFWHERE  (M.CODE LIKE '7%') AND TOTTYPE=1 AND L.ORGUNITREF&amp;lt;&amp;gt;'-1' AND L.TOTMONTH&amp;lt;&amp;gt;'-1' AND L.DEBIT-L.CREDIT&amp;lt;&amp;gt;0 AND L.ORGUNITREF IN(104) GROUP BY M.CODE,M.DESCRIPTION,L.DEBIT-L.CREDIT,L.TOTMONTH)DataTable PIVOT (SUM(TOPLAM) FOR ay IN ([Ocak],[Subat],[Mart],[Nisan],[Mayis],[Haziran],[Temmuz],[Agustos],[Eylul],[Ekim],[Kasim],[Aral]))PivotTable order by 1Thanks</description><pubDate>Wed, 07 Dec 2011 05:12:00 GMT</pubDate><dc:creator>sezeren</dc:creator></item></channel></rss>