Results 1 to 3 of 3
  1. #1
    5 Star Lounger
    Join Date
    Jan 2001
    Posts
    1,119
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Report Help (2000)

    I am trying to recreate a report. I have two tables.
    In one table the fields are Product, Clients, Contracts, Members.
    In the other table it only has 1 product called Drug. (All the other products are in the field "Product" in the other table.
    It also has Clients, Contracts and members.

    My problem is the Report I am trying to recreate has Products down the side and across the top is "Clients", "Contracts", and "Members"

    I created a totals query for each of the tables. I created a field called Products in the Drug table by putting Product: "Drug" as a field.
    I have what I want in the two queries but how do I get them in the same report so that drug is part of the Products field .

    In the drug query, I have Product, Clients, Contracts, Members and the same in the other query.
    I need to combine the 2 queries so that the drug info is combined with the other info in the other query.

    I don't know why the drug information is in a table by itself but it is.

    I don't know how to make drug as one of the products. I can do it by itself. I guess if I had to I could make one report for drug and one for the other products.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Report Help (2000)

    You can create a union query to combine the results of the two queries. It will work best if the order of the fields is the same in both queries.

    Start by creating a new query based on one of the queries. Add * to the query grid.
    Select View | SQL to see the SQL for the query. It will look like this:
    <code>
    SELECT QueryA.*
    FROM QueryA;
    </code>
    Edit it to look like this, with the correct query names substituted, of course:
    <code>
    SELECT QueryA.*
    FROM QueryA
    UNION SELECT QueryB.*
    FROM QueryB;
    </code>
    Save this query, and use it as record source for a report.

  3. #3
    5 Star Lounger
    Join Date
    Jan 2001
    Posts
    1,119
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Report Help (2000)

    Thanks again Hans. Worked perfectly.

Posting Permissions

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