SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 please help me calculate advance payment in sql T_
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

jheign02
Starting Member

1 Posts

Posted - 04/09/2012 :  19:05:45  Show Profile  Reply with Quote
i need to make a query that automatically compute advance payments..the excess amount will automatically added to next row..the output goes like this...

id date payment amount
1 3/3/2012 20 20---if the customer pay 50.(50-20=30)
1 3/4/2012 10 10----(30-10=20)
1 3/5/2012 10 10----(20-10=10)
1 3/6/2012 20 10---we have ramaining 10 bal. for this day
1 3/7/2012 20+10=30 0
1 3/8/2012 10 0--and so on

PLEASE HELP ME...

visakh16
Very Important crosS Applying yaK Herder

India
47189 Posts

Posted - 04/10/2012 :  16:16:44  Show Profile  Reply with Quote
sorry your output is not clear

is the initial payment value (50) input from user?

also till what point you need to keep on accruing the remaining amount to next payment?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.06 seconds. Powered By: Snitz Forums 2000