TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Aseem Bhardwaj
1.6k
114
20.6k
broad forward for getting total till current date
Oct 29 2016 7:38 AM
hi,
here is my stored procedure... give me solution for amendment for broadforward method:-
create procedure sp_broadForward
(
@gl_acid int,
@userid int,
@dateFrom datetime,
@dateTo datetime
)
as
begin
SELECT ROW_NUMBER() OVER (Order by gLedeger.PK_id) as sno,gLedeger.gl_date as date,gLedeger.gl_narration as Narration ,
case when gLedeger.gl_drcr > 0 then abs(gLedeger.gl_drcr) else 0.00 end as debit,
case when gLedeger.GL_DRCR < 0 then abs(gLedeger.gl_drcr) else 0.00 end as credit,
SUM(gLedeger.gl_drcr) OVER(ORDER BY gledeger.pk_ID ROWS UNBOUNDED PRECEDING) AS Balance
FROM gLedeger LEFT JOIN master ON
gLedeger.gl_acid = master.PK_ID left join registration r on master.userId= @userid
WHERE gLedeger.gl_acid = @gl_acid
and gl_date between Convert(Date, @dateFrom ,103) and Convert(Date,@dateTo,103)
ORDER BY gLedeger.gl_date
end
Reply
Answers (
4
)
SQL COALESCE Function
Write a sql Query as per given scenarios