>>>Thanks sir for helping
>>>
>>>But
>>>
>>>These codes will not update nSeconds column in SQLserver table.
>>>
>>>I need for sqlserver, please
>>
>>
>>Take a look at the LAG capabilities with the OVER clause. I wrote about LAG (and its partner, LEAD) here:
http://www.tomorrowssolutionsllc.com/Articles/Using%20Over%20with%20Analytic%20Functions,%20Part%201.pdf. They let you access data from preceding and following records.
>>
>>Tamar
>
>Hi,
>
>Muhammad use MS SQL 2008R2. LAG() and LEAD() are since MSSQL 2012.
>
Good catch. I missed the 2008 constraint.
Tamar