Quantcast
Channel: SQL Server Reporting Services
Viewing all articles
Browse latest Browse all 1418

running total in sql server without key value

$
0
0

Hi Team,

I want to take running Total(cumulative Total) column where i dont have any orderid(Key value) in my query this is my query

select sms.LadleNo,sms.DateStamp,sms.heatNo HeatNo,(case sms.plantNo when 9 then 1 when 10 then 2 when 11 then 3 when 12 then 3 else 0 End) LF,
   bof.TAPSTART,bof.TAPEND,SMS.actStrt as LFIn,SMS.actEnnd as LFOut
   ,DATEDIFF(MINUTE,BOF.TAPEND,SMS.actEnnd) as ProcessTime,ROW_NUMBER() OVER(PARTITION BY sms.LADLENO ORDER BY sms.actEnnd DESC) AS LadleLife
  --here i want to add cummulative column
    from smsHeatTracker sms INNER JOIN BOF_HEAT_MIS_DATA bof ON sms.heatNo=bof.HEAT_ID_CUST and sms.plantNo in (9,10,11,12)
    where Convert(char(10),SMS.actEnnd,126)='2015-06-30'  order by sms.LadleNo desc

thanks in advance


Viewing all articles
Browse latest Browse all 1418

Trending Articles