on 10-11-2012 6:48 AM
Dear Friends, Pls see the below query,i want serial no (like 1,2,3....) and row wise sum details..pls help
SELECT T1.seriesName,T0.DocNum, T0.[DocDate], T0.[CardCode] AS 'Coust Code',T0.CardName, T0.[CashSum] ,T0.[CheckSum] ,T0.[TrsfrSum] as 'RTGS Amount', T0.[DocTotal] AS 'Doc Total', T0.[PrjCode] FROM ORCT T0 INNER JOIN NNM1 T1 ON T0.Series = T1.Series WHERE T0.[DocType]='C' and T0.[Canceled] ='N' AND convert(varchar(12),T0.[DocDate],103)=convert(varchar(12),dateadd(DD,-1,getdate()),103) ORDER BY T0.[DocEntry]
Hi,
what do you mean with row wise sum ?
For any kind of aggregation you can use the GROUP BY clause in the select statement e.g.
Select
SeriesName,
sum(something) as Sum1,
count(somethingelse) as Count1
from table
group by
Seriesname
See SQL Server Books Online http://msdn.microsoft.com/en-us/library/ms177673.aspx
Regards
Clas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
78 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.