Hi Sreehari,
I will simplify the requirement , below is the sample data, the explanation of the calculation involved,
ID Date column 1 Cumulative sum Comment
1 9-14-2014 14:05:00 1 1 (col1) =1
1 9-14-2014 14:22:00 1 2 (col1+previous cumulative sum) =1+1
1 9-14-2014 14:25:00 1 3 (col1+Previous cumulative sum) =1+2
1 9-14-2014 14:37:00 0 0 (col1)=0
1 9-14-2014 15:02:00 0 0 (col1)=0
1 9-14-2014 15:12:00 1 1 (col1)=1
1 9-14-2014 15:18:00 1 2 (col1+previous cumulative sum)=1+1
1 9-14-2014 15:21:00 1 3 (col1+previous cumulative sum)=1+2