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
 General SQL Server Forums
 New to SQL Server Programming
 opening balance 2
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

srisha
Starting Member

India
38 Posts

Posted - 06/21/2013 :  03:36:03  Show Profile  Reply with Quote
i want to running total after opening balance


--------------------------
BY
SRISHA

visakh16
Very Important crosS Applying yaK Herder

India
52317 Posts

Posted - 06/21/2013 :  03:46:23  Show Profile  Reply with Quote
see one approach using APPLY here

http://visakhm.blogspot.com/2010/01/multipurpose-apply-operator.html

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page

srisha
Starting Member

India
38 Posts

Posted - 06/21/2013 :  03:49:17  Show Profile  Reply with Quote
numberVar bal;
if(recordnumber = 1)
then bal={@main}+({@Debit}-{@Credit});

else (recordnumber > 1)
then (bal+({@Debit}-{@Credit}));

--------------------------
BY
SRISHA
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52317 Posts

Posted - 06/21/2013 :  03:53:19  Show Profile  Reply with Quote
Are you expecting a t-sql solution? Above posted code is not t-sql

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page

srisha
Starting Member

India
38 Posts

Posted - 06/21/2013 :  03:58:57  Show Profile  Reply with Quote
no expecting ms sql only


--------------------------
BY
SRISHA
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52317 Posts

Posted - 06/21/2013 :  04:03:59  Show Profile  Reply with Quote
quote:
Originally posted by srisha

no expecting ms sql only


--------------------------
BY
SRISHA


thats what i asked
ms sqls programming standard is transact sql or t-sql

your posted didnt resemble t-sql syntax (use of { etc)

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
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.09 seconds. Powered By: Snitz Forums 2000