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.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 How to caluculate attrition,newvolume for deposit

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 server
account number
currentmonth
account ledger balance
deposit count
account type sesc
creditcount
debit amount
debit count
transaction account

attritionflag
newvolumeflag
retensitonflag
regentionflag
glaccountnumber
age
ASOFDATE
BILLPAYING
ACHFLAG
ACCOUNTOPENDATE
CURRENTMONTH
PREVIOUSMONTH
TRANSACTIONCODE
BRANCHNUMBER
CHANNEL
HISTORY SOURCE
ID

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2014-09-14 : 18:50:17
I could write an answer like
select * 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
Go to Top of Page

chikupalli
Starting Member

3 Posts

Posted - 2014-09-15 : 07:22:26
quote:
Originally posted by SwePeso

I could write an answer like
select * 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?
Go to Top of Page

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
Go to Top of Page
   

- Advertisement -