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 2005 Forums
 Transact-SQL (2005)
 Jeff Smith Runs/Streak Script

Author  Topic 

seidburns850
Starting Member

1 Post

Posted - 2009-05-03 : 17:05:58
http://www.sqlteam.com/article/detecting-runs-or-streaks-in-your-data

How would I alter that not to track streaks across uniqute dates but rather across several entries PER date.

Primarily, if we have data like this:

DATE EVENT_NUM HR
3/31 1225 1
3/31 1232 0
3/31 1243 0
3/31 1257 0
4/2 1342 1
4/2 1394 1
4/2 1399 0
4/3 1404 0
4/3 1412 0
4/4 1565 0
4/4 1587 1

Since the dates are not unique, I'd want to doctor that above linked-script to tell me how many event_num entries occur between each run group.

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2009-05-03 : 23:42:48
Moving this out of the Script Library forum since this isn't a working script.

You might want to just add your question to the comments of that article.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog

"Let's begin with the premise that everything you've done up until this point is wrong."
Go to Top of Page
   

- Advertisement -