Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2012
    Posts
    9

    Unanswered: grouping and pairing transactions over time

    I have a table with the below columns. I would like to create the result table below that pairs transactions with "LIKE" transactions. The only exception is that "OUT" can basically stop anything.

    compID commID TRANS DATE UNIT
    1 1 MSF 1/1/2012 101
    1 2 CS1 1/1/2012 101
    1 3 CS2 2/1/2012 101
    1 10 OUT 5/1/2012 101
    1 12 MSF 5/2/2012 301
    1 13 CS1 5/2/2012 301
    1 14 CS2 6/2/2012 301
    1 15 OUT 10/2/2012 301
    2 4 MSF 1/1/2012 102
    2 5 CS0 1/1/2012 102
    2 6 CS1 1/5/2012 102
    2 7 AWAY 5/1/2012 102
    2 8 RETURN 5/25/2012 102
    2 11 CS3 5/25/2012 102
    2 9 OUT 7/1/2012 102



    START.compID STOP.compID START.commID STOP.commID START.TRANS STOP.TRANS START.DATE STOP.DATE DAYS START.UNIT STOP.UNIT
    1 1 1 10 MSF OUT 1/1/12 0:00 4/30/12 23:59 121.00 101 101
    1 1 2 3 CS1 CS2 1/2/12 0:00 1/31/12 23:59 30.00 101 101
    1 1 3 10 CS2 OUT 2/1/12 0:00 4/30/12 23:59 90.00 101 101
    1 1 12 15 MSF OUT 5/2/12 0:00 10/1/12 23:59 153.00 301 301
    1 1 13 14 CS1 CS2 5/2/12 0:00 6/1/12 23:59 31.00 301 301
    1 1 14 15 CS2 OUT 6/2/12 0:00 10/1/12 23:59 122.00 301 301
    2 2 4 9 MSF OUT 1/1/12 0:00 6/30/2012 23:59 182.00 102 102
    2 2 5 6 CS0 CS1 1/1/12 0:00 1/4/2012 23:59 4.00 102 102
    2 2 6 11 CS1 CS3 1/5/12 0:00 5/24/2012 23:59 141.00 102 102
    2 2 7 8 AWAY RETURN 5/1/12 0:00 5/24/2012 23:59 24.00 102 102
    2 2 11 9 CS3 OUT 5/25/12 0:00 6/30/2012 23:59 37.00 102 102

  2. #2
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    What defines "LIKE" ???

    -PatP
    In theory, theory and practice are identical. In practice, theory and practice are unrelated.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •