Results 1 to 1 of 1
  1. #1
    Join Date
    Jun 2012
    Posts
    19

    Unanswered: Select only records with duplicate values

    I have the following tables, Table_Acct, Table_Call, Table_Acct_Call that link calls to accounts in my workplace.

    I need to generate a report that will show me any call made to the same store, with the same store on a different date. Table_Call.Name, Table_Call.Type, Table_Call.Date, Table_Acct.Shop

    Table_Acct
    ID | Shop |
    ===========
    1 | Shop1 |
    2 | Shop2 |
    3 | Shop3 |

    Table_Call
    ID | Name | Type | Date |
    ============================
    A | Call1 | FU | 12/02/2012
    B | Call2 | CC | 12/01/2012
    C | Call3 | FU | 12/03/2012
    D | Call4 | CC | 12/02/2012
    E | Call5 | CC | 12/02/2012
    F | Call6 | CC | 12/03/2012

    Table_Acct_Call
    ID | Account_ID | Call_ID |
    =======================
    1A | 1 | A |
    1B | 1 | B |
    1C | 1 | C |
    2D | 2 | D |
    3E | 3 | E |
    3F | 3 | F |


    For example
    Shop 1 had 3 calls, two of which are the same type FU, and on a different date.
    Shop 3 also has 2 calls of the same type on different dates.

    So the result would be
    Name | Type | Date | Shop |
    ================================
    Call1 | FU | 12/02/2012 | Shop1 |
    Call3 | FU | 12/03/2012 | Shop1 |
    Call5 | CC | 12/02/2012 | Shop3 |
    Call6 | CC | 12/03/2012 | Shop3 |

    Hopefully that makes sense.

    Thanks
    Last edited by BridgeCat; 10-31-12 at 01:28.

Posting Permissions

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