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 |
chikupalli
Starting Member
3 Posts |
Posted - 2014-09-14 : 08:34:59
|
Hi there,Can some one help me how to calculate attrition count, balance and new volume count and balance for a given period, based on account ID branch and type of deposit?It is a sql serveraccount numbercurrentmonthaccount ledger balancedeposit countaccount type sesccreditcountdebit amountdebit counttransaction accountattritionflagnewvolumeflagretensitonflagregentionflagglaccountnumberageASOFDATEBILLPAYINGACHFLAGACCOUNTOPENDATECURRENTMONTHPREVIOUSMONTHTRANSACTIONCODEBRANCHNUMBERCHANNELHISTORY SOURCEID |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2014-09-14 : 18:50:17
|
I could write an answer likeselect * from dbo.MyMagicBox but that would be to easy.Help us help you by posting your table structure and some sample data.Together with that, post the expected output for the posted sample data, with a clear explanation how you did get to the wanted result. Microsoft SQL Server MVP, MCT, MCSE, MCSA, MCP, MCITP, MCTS, MCDBA |
|
|
chikupalli
Starting Member
3 Posts |
Posted - 2014-09-15 : 07:22:26
|
quote: Originally posted by SwePeso I could write an answer likeselect * from dbo.MyMagicBox but that would be to easy.Help us help you by posting your table structure and some sample data.Together with that, post the expected output for the posted sample data, with a clear explanation how you did get to the wanted result. Microsoft SQL Server MVP, MCT, MCSE, MCSA, MCP, MCITP, MCTS, MCDBA
Added the table structure. let me know if you need any other info? |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2014-09-15 : 08:34:09
|
With this little information, the best help I can provide is that you will need some aggregate function, such as SUM and COUNT.Perhaps some will be windowed, and some will not. Microsoft SQL Server MVP, MCT, MCSE, MCSA, MCP, MCITP, MCTS, MCDBA |
|
|
|
|
|
|
|