Results 1 to 4 of 4
  1. #1
    dollygg is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Jul 2009
    Posts
    73

    query

    Table A:

    site phonetype number
    1 phone 18001234567
    1 fax 18661245789


    Result wanted:


    phoneNumber faxnumber
    18001234567 18661245789

  2. #2
    Rawb is offline Expert
    Windows 7 64bit Access 2010 32bit
    Join Date
    Dec 2009
    Location
    Somewhere
    Posts
    875
    Those Records have different site values.

    Unless there is some other information linking the Records together somehow, you won't be able to do it.

  3. #3
    dollygg is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Jul 2009
    Posts
    73
    Actually the site number is same. I just fixed that.

  4. #4
    Rawb is offline Expert
    Windows 7 64bit Access 2010 32bit
    Join Date
    Dec 2009
    Location
    Somewhere
    Posts
    875
    Probably the easiest is to use an INNER JOIN to connect two copies of your Table together.

    Code:
    SELECT TableA.[site], TableA.[number] AS PhoneNumber, TableA_1.[number] AS FaxNumber
    FROM TableA INNER JOIN TableA AS TableA_1 ON TableA.[site] = TableA_1.[site]
    WHERE TableA.[numbertype]="phone" AND TableA_1.[numbertype]="fax"

Please reply to this thread with any new information or opinions.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums