Results 1 to 3 of 3
  1. #1
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question On Union Query? (a2k (9.0.6926) SP-3 Jet 4.0 SP-8)

    I have the following query that works, however it is returning all the records in the table.

    Ther are 1,721 records in tblDentists, 671 are Active and 1.050 are Inactive

    When I run the query it returns 844 records.

    Shouldn

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

    Re: Question On Union Query? (a2k (9.0.6926) SP-3 Jet 4.0 SP-8)

    Your statements are contradictory. If the table contains 1,721 records and the query returns 844 records, "however it is returning all the records in the table" cannot be true.

    The explanation why it does not return 2x671 records is that there must be overlap between the values of strDrOfficeName and of strDrContactName. By default, a union query weeds out duplicates. If you don't want that, use UNION ALL instead of UNION.

  3. #3
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Question On Union Query? (a2k (9.0.6926) SP-3 Jet 4.0 SP-8)

    Sorry for the typo

    Fantastic! Union is what I want in this case

    Thanks, John

Posting Permissions

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