on 02-14-2011 3:53 PM
Hi
CREATE TABLE #temp(sr_No int ,remarks nvarchar(150),Particulars nvarchar(100),
opening numeric(19,6),receipt numeric(19,6), issue numeric(19,6),closing numeric(19,6))
insert into #temp select ROW_NUMBER() OVER (ORDER BY opening) ,'','', sum(outqty), 0 , 0 , 0 from oinm t0 where t0.docdate < '12/1/2010'
insert into #temp select ROW_NUMBER() OVER (ORDER BY opening) ,'',warehouse, 0, sum(inqty) , 0 , 0 from oinm t0 where t0.docdate >=
'12/1/2010' and t0.docdate <= '12/31/2010' group by warehouse
select sr_no,(remarks),particulars 'Particulars',sum(opening)'Opening',sum(receipt)'Receipt',sum(issue)'Issued',(sum(Opening)+sum(Receipt))-Sum(Issue)'Closing' from #temp
group by sr_no,remarks,particulars
drop table #temp
In this query i want to autogenerate serial no and then Grand Total
Thanks
Closed.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
89 | |
7 | |
7 | |
4 | |
4 | |
3 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.