Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 [interesting] Selecting MAX Consecutive Results

Author  Topic 

zippy
Yak Posting Veteran

69 Posts

Posted - 2002-01-31 : 03:44:30
Hi,
This is kind of an interesting question and I think it may be quite hard to get you to understand it.

I have a table which contains results which are split up by user and the day that they were entered (Coloumns: UserID, Thedate)
What I need to do is generate a list where the user has consecutively(ie day after day) posted a result. From this list I want to select the largest time frame and figure out how many days it was.
This is the only information I want out of the whole thing. The longest length of time that the user has posted a result day after day.

Is that clear as mud?
Hope you can help,
Derek

Check out the worlds fastest computers at http://www.ocgurus.com

Merkin
Funky Drop Bear Fearing SQL Dude!

4970 Posts

Posted - 2002-01-31 : 05:01:10
Hey

Yeah, these are always fun. What you should do, is go buy a copy of Ken Henderson's book, The Guru's Guide to Transact SQL. (Im not putting a link to the sqlteam store because I know what the NZ dollar is compared to the US dollar).

Ken has a whole chapter on this sort of stuff, and it is well worth a read.

Damian
Go to Top of Page

zippy
Yak Posting Veteran

69 Posts

Posted - 2002-01-31 : 05:57:15
huh!
i allready have it, but completely forgot to check it out.
yes it was horribly expensive!

Check out the worlds fastest computers at http://www.ocgurus.com
Go to Top of Page
   

- Advertisement -