If you were to log in, you'd be able to get more information on your fellow community member.
"Some Profoundly Painful Things -- Calculating time intervals between rows in a table" is very useful, thank you. Some people may need the following technique to establish a sequential numeric identifier. (In the example you assume "user_id column, which we know to be sequential and unique") declare @tmp (registration_date datetime) insert @tmp select identity(int,1,1) as Sequence, registration_date into #x from users order by registration_date ... (now use #x instead of users in the example) drop table #x