Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Steroids needed
Message
From
01/04/2003 10:12:23
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Steroids needed
Miscellaneous
Thread ID:
00772404
Message ID:
00772404
Views:
49
I have data with this structure :
checkdate  xclusive id1   id2   nstart  nend
---------- -------- ---   ---   ------  ----
01/01/2003     F     1     1      96     120
01/01/2003     F     1     1     108     120
01/01/2003     F     1     1     108     120
01/01/2003     F     1     1     108     120

01/01/2003     F     2     1      96     108
01/01/2003     F     2     1     102     120
01/01/2003     F     2     1     102     120

01/02/2003     F     2     1      96     108
01/02/2003     F     2     1      96     132
01/02/2003     F     2     1     102     108
01/02/2003     F     2     1     102     120
01/02/2003     F     2     1     102     120
Start,End are in the range 1,186.

What I need is counts for distinct Date,Start,End (ids and xcl matter). There are overlaps in Start/End and I need to split them.

Above samples counts should be as :
checkdate  xclusive id1   id2   nstart  nend  cnts
---------- -------- ---   ---   ------  ----  ----
01/01/2003     F     1     1      96     108    1
01/01/2003     F     1     1     108     120    4

01/01/2003     F     2     1      96     102    1
01/01/2003     F     2     1     102     108    3
01/01/2003     F     2     1     108     120    2

01/02/2003     F     2     1      96     102    2
01/02/2003     F     2     1     102     108    5
01/02/2003     F     2     1     108     120    3
01/02/2003     F     2     1     120     132    1
Any ideas on a fast routine to do this. TIA.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Next
Reply
Map
View

Click here to load this message in the networking platform