Home All Groups Group Topic Archive Search About

Counting Consecutive days in SQL

Author
30 Jun 2006 7:36 PM
VibroluxOn10
I've been trying to figure out how to count the number of consecutive
days of entries in a table. the table stores data on number of minutes
exercised in a day for users of an exercise program:

ExerciseId int
UserId int
Minutes int
ExerciseDate datetime

I need to produce a list of users who exercised XX number of days in a
row. e.g. 60 consecutive days of exercise. Any ideas on how to do that?
I'm using SQL Server 2000.

Thanks

Author
30 Jun 2006 7:45 PM
Tracy McKibben
VibroluxO***@gmail.com wrote:
Show quote
> I've been trying to figure out how to count the number of consecutive
> days of entries in a table. the table stores data on number of minutes
> exercised in a day for users of an exercise program:
>
> ExerciseId int
> UserId int
> Minutes int
> ExerciseDate datetime
>
> I need to produce a list of users who exercised XX number of days in a
> row. e.g. 60 consecutive days of exercise. Any ideas on how to do that?
> I'm using SQL Server 2000.
>
> Thanks
>

http://www.aspfaq.com/show.asp?id=2519

AddThis Social Bookmark Button