Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
kond.mohan
Posting Yak Master
213 Posts |
Posted - 2014-04-07 : 09:13:58
|
Dear alli need to prepare the MTD and YTD Logic for my Reporting purpose using Sql server.this is my query SELECT bsis.hkont GLCODE,skat.TXT50 GLDESCRITPTION ,GLMASTER.GROUP1,GLMASTER.GROUP2,GLMASTER.GROUP3,GLMASTER.GROUP4,bsis.PRCTR PROFITCTR,BSIS.SEGMENT ,BSIS.BUDAT,REPLACE(RIGHT(CONVERT(VARCHAR(9), BSIS.BUDAT, 6), 6), ' ', '-') DATE,SUM(DMBTR) "ACTUALAMTRS IN LACS" from bsis inner join SKAT on bsis.hkont= skat.SAKNR INNER JOIN GLMASTER ON GLMASTER.GLCODE=bsis.hkontWHERE bsis.BUDAT between '2012-04-01' AND '2012-05-31'--AND BSIS.HKONT IN ('0031037200')GROUP BY BSIS.HKONT,bsis.hkont ,skat.TXT50 ,BSIS.BUDAT,bsis.PRCTR ,BSIS.SEGMENT ,GLMASTER.GROUP1,GLMASTER.GROUP2,GLMASTER.GROUP3,GLMASTER.GROUP4i need one more column on SUM(DMBTR) this column for cumulative baed on date filed and |
|
sqlsaga
Yak Posting Veteran
93 Posts |
|
|
|
|
|
|