Results 1 to 6 of 6
  1. #1
    Join Date
    Mar 2004
    Posts
    29

    Unanswered: SQL 2000 2 tables using UNION

    I have 2 Tables one called Reps and the other called STORES
    I need to use a UNION statement but my Server is saying that the "UNION" is ERROR The Query Designer does not support the UNION SQL construct.

    What command would I use to put these 2 tables together?
    HELP!

  2. #2
    Join Date
    Nov 2005
    Location
    San Francisco, CA
    Posts
    506
    Quote Originally Posted by cle5cap
    I have 2 Tables one called Reps and the other called STORES
    I need to use a UNION statement but my Server is saying that the "UNION" is ERROR The Query Designer does not support the UNION SQL construct.

    What command would I use to put these 2 tables together?
    HELP!
    Read BOL about union.
    check this out LINK
    Success is the ability to go from one failure to another with no loss of enthusiasm.
    - Sir Winston Churchill
    Joydeep

  3. #3
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Hi

    in particular check out the "two basic rules" for UNOINS in Joydeep's link. The two tables to be unioned need to be union compatible. Ordinarily they would be two tables\ views containing similar data from different sources. This doesn't sound like it is the case based on the table names you have mentioned.

    A stab in the dark but - sounds to me like you want to JOIN. I could be wrong but if you still struggle with the UNION and need more help - check out Brett's sticky and provide some more information.

    HTH
    Testimonial:
    pootle flump
    ur codings are working excelent.

  4. #4
    Join Date
    Mar 2004
    Posts
    29
    It works now here is my statement thank you for the help


    SELECT dbo.Rep.[Employee Number], dbo.Rep.[First name], dbo.Rep.[last name], dbo.Rep.Address, dbo.Rep.[address 2], dbo.Rep.city, dbo.Rep.State,
    dbo.Rep.Zip, dbo.Rep.Telephone, dbo.Rep.[e-mail address]
    FROM dbo.Rep
    UNION
    SELECT dbo.Stores.Store_no, dbo.Stores.Store_name, dbo.Stores.Store_id, dbo.Stores.Account_id, dbo.Stores.address, dbo.Stores.city, dbo.stores.state,
    dbo.stores.zip, dbo.stores.phone, dbo.stores.email
    FROM stores

  5. #5
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Uh - ok. Just one thing - are you sure that's what the output you want? Reps last name and store ID in the same column? Or are you just testing SQL concepts?
    Testimonial:
    pootle flump
    ur codings are working excelent.

  6. #6
    Join Date
    Mar 2004
    Posts
    29
    Yes you are right I am just testing to make sure that I can combine two tables into 1 table so that I can use a ODBC connection to the 1 ship to table.

    Thank you again!

Posting Permissions

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