Results 1 to 5 of 5
  1. #1
    Join Date
    Feb 2007
    Posts
    84

    Unanswered: Combine two rows into one row

    Is there any way to combine multiple rows into one row? I have a field called MILESTONES that has 3 different milestones and I did a decode statement to separate the RECEIVED_DATES which are now DOCS_COMPLETE_DATE, UPLOAD_DATE, and FORWARD_TO_ONEPOINT_DATE.

    There will be NULLS per some of the milestones dates. Somehow I would like to try combining these multiple trx rows into one row, if possible.

    Can you help?
    Attached Files Attached Files

  2. #2
    Join Date
    May 2004
    Location
    Dominican Republic
    Posts
    721
    I am not sure about your output (it is pivot or not?).. could you post an example ?

  3. #3
    Join Date
    Feb 2007
    Posts
    84

    Attached is output

    Attached is an example of the output. I don't need to see the MILESTONE name in the output, just one trx# and the dates displayed on one row.
    Attached Files Attached Files

  4. #4
    Join Date
    May 2004
    Location
    Dominican Republic
    Posts
    721
    but what if you have two (or more?) dates on UPLOAD_DATE / FORWARD_TO_ONEPOINT_DATE for a given transaction, which date will be the one you like ?

    sounds like a simple group by with max/min for me..

  5. #5
    Join Date
    Feb 2007
    Posts
    84
    The first date and time, if there is more than one date. It doesn't seem that simple to me. Here is part of the select statement, I commented out the decode statements to separate the RECEIVE DATE. I've did a min funtion on the RECEIVE DATE.


    SELECT DISTINCT MB.PROCESSING_CENTER_CODE AS REGION,
    E.ENTITY_NO AS TRANSACTION_NO,
    LOOKUP_DESCRIPTION_F ('Financial Trx Milestone', EMV.ENTITY_MILESTONE_CODE) AS MILESTONE,
    /*DECODE(LOOKUP_DESCRIPTION_F ('Financial Trx Milestone', EMV.ENTITY_MILESTONE_CODE), 'Documents Completed and Submitted to Banker', EMV.MILESTONE_ACT_DATE, NULL) AS DOCS_COMPLETE_DATE,
    DECODE(LOOKUP_DESCRIPTION_F ('Financial Trx Milestone', EMV.ENTITY_MILESTONE_CODE), 'Routed to LSC-Upload Completed', EMV.MILESTONE_ACT_DATE, NULL) AS UPLOAD_DATE,
    DECODE(LOOKUP_DESCRIPTION_F ('Financial Trx Milestone', EMV.ENTITY_MILESTONE_CODE), 'Collateral Upload Complete-Forwarded for One Point Updates', EMV.MILESTONE_ACT_DATE, NULL) AS FORWARD_TO_ONEPOINT_DATE, */
    MIN(EMV.MILESTONE_ACT_DATE) AS RECEIVED_DATE,




    Thanks.

Posting Permissions

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