cancel
Showing results for 
Search instead for 
Did you mean: 

Serial No & Row wise Sum

Former Member
0 Kudos

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]

Accepted Solutions (0)

Answers (1)

Answers (1)

clas_hortien
Employee
Employee
0 Kudos

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