DataTable date issue

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • ApeX

    DataTable date issue

    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
  • RobinS

    #2
    Re: DataTable date issue

    What's the trick? Merging the tables and then sorting by the first date?

    RobinS.
    -----------------------------------------
    "ApeX" <mmojas@gmail.c omwrote in message
    news:9094e737-f4fd-479f-8152-7c93d3654080@i7 2g2000hsd.googl egroups.com...
    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

    Comment

    • ApeX

      #3
      Re: DataTable date issue

      On 9 velj, 08:59, "RobinS" <rob...@imnotte lling.comwrote:
      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

      Comment

      • RobinS

        #4
        Re: DataTable date issue

        You would have to write your own algorithm for that, parsing the data and
        creating a new dataset.

        RobinS.
        ----------------------------
        "ApeX" <mmojas@gmail.c omwrote in message
        news:e3812a5c-1590-4c1d-8575-9c25d51e9efa@d2 1g2000prf.googl egroups.com...
        On 9 velj, 08:59, "RobinS" <rob...@imnotte lling.comwrote:
        >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

        Comment

        Working...