DataTable date issue

  • Thread starter Thread starter ApeX
  • Start date Start date
A

ApeX

hello, can anybody please give me some advice or a pseudocode for the
following:

i got two datatables filled with dates, i need to fill a third
datatable with values from the other two but the trick is:

first datatable
******************
28.8.2007 - 2.10.2007
5.10.2007 - 4.11.2007
5.11.2007 - 31.12.2007

second datatable
*********************
11.12.2007 - 21.12.2007
24.12.2007 - 31.12.2007

i have to fill the third datatable with following data :

28.8.2007 - 2.10.2007
5.10.2007 - 4.11.2007
5.11.2007 - 10.12.2007
11.12.2007 - 21.12.2007
22.12.2007 - 23.12.2007
24.12.2007 - 31.12.2007
 
What's the trick? Merging the tables and then sorting by the first date?


well, the trick is if the range from the second datatable is withing
some of the ranges in the first datatable,
they must be broken by adding or removing days according to the range
in the previous and next added dates.
for example:

1) 1.11.2007 - 15.11.2007

2). 6.11.2007 - 9.1..2007

so i need to have:

1.11.2007 - 5.11.2007
6.11.2007 - 9.11.2007
10.11.2007 - 15.11.2007
 
You would have to write your own algorithm for that, parsing the data and
creating a new dataset.

RobinS.
----------------------------
 
Back
Top