need to make a "flat file" query from MS Access or MSSQL 2005 database

Posted on 2012-09-19
Last Modified: 2012-09-20
Hi, I need to make a "flat file" from two database table. The attached files show a simple two table database. Both tables are related by the "phone" column. The "master-addresses-and-phones.xls" file is a list of phone numbers and addresses. The phone number in this table is the primary key. The "master-name-and-phones.xls" file list of names and phone numbers. the "query-results.xls" file is the desired result.

Basicly, I need to put all the people's names in the same row with the correct address/phone related by the phone number. Some relations can have one name and other could have 8-10.

I am working in MS Access, but could set this up in MSSQL 2005 as well. Thanks for any tips.
Question by:Mark B
    LVL 39

    Accepted Solution

    Try this sample. Open query Q. Query Q1 is inserted into Q's SQL, but you can use it also separately.

    Author Closing Comment

    by:Mark B
    That is the solution. Will take some time to apply to the more complex database we have, but makes sense and will learn something new!

    Featured Post

    What Security Threats Are You Missing?

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    oracle query help 29 48
    SQL Server 2012 express 24 21
    calculated field in a table? 3 20
    SQL syntax error in VBA 11 18
    In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
    In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
    Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
    In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now