Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Break in Sequence

Status
Not open for further replies.

clanguage1

Programmer
Jun 27, 2007
3
US
Hello,
does anyone knows of a way to group a set of records everytime a break in a sequence occurs. Let me explain.
I have a sequence of numbers like 1,2,3,4,5,7,8,9 when I reach the break (6) I need to group 1,2,3,4, and 5 together and 7,8, and 9 next and so on.
I have it working with a cursor but it seems slow. There has to be a more elegant and better way to do it.
Any help would be appreciated. In advance thank you


 
Can you show sample data/desired results please?

Alex

Ignorance of certain subjects is a great part of wisdom
 
Hello Alexcuse
I have a sequence like
150
151
152
153
155
156
157
30001
30002
30003
30002
30003
30004
The difficulty lies in that there can be duplicate numbers. Of course I have another piece of information. The product mcq44 starting at 150, dmr26 starting at 30001
and dmz55 starting at 300002.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top