Results 1 to 4 of 4
  1. #1
    4 Star Lounger
    Join Date
    Aug 2001
    Location
    London, UK
    Posts
    516
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Union query (acccess 2000)

    Could somebody help me create a union query, I want to join two queries and mail merge it with word. Both queries have exactly the same fields and the data is extracted from the same table. The only difference is that, one query has amended records and the other one has original records. I would like to join these two queries and create a cross tab query and mail merge it with word.

  2. #2
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Union query (acccess 2000)

    To create a union query, you have create a new query.
    Don' add tables
    Swith the view to SQL view and type you select statement.
    somethong like this:
    SELECT id, name FROM table1 UNION SELECT id, name FROM table2 ORDER BY name
    and save your query.
    Union queries can't be graphicly designed like other queries. You have to create you own SQL-statement.
    After you learn Visual Basic, you now have to learn SQL <img src=/S/bummer.gif border=0 alt=bummer width=15 height=15> <img src=/S/brainwash.gif border=0 alt=brainwash width=15 height=15>
    But don't worry, one day, when you know all, you'll know you know nothing
    Francois

  3. #3
    4 Star Lounger
    Join Date
    Aug 2001
    Location
    London, UK
    Posts
    516
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Union query (acccess 2000)

    Thank you Francois, The last sentence of your reply made me feel a lot better. I'm a computer science student who has no idea about visual basic but am doing a placement which involves access programming and the only thing which makes me feel that I could do this is the help I get over the net.
    Thanks alot. it works now I have to see whether it works as a cross tab query coz It was summing the value feild earlier on. Thanks again. <img src=/S/joy.gif border=0 alt=joy width=23 height=23>

  4. #4
    New Lounger
    Join Date
    Apr 2002
    Location
    Phoenix, AZ, USA
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Union query (acccess 2000)

    One thing I found out about in Union queries that you may or may not need to know in your application, is that Union queries will (by default) only add unique records. So if you have duplicate records in the queries your uniting, and you need all the records, even duplicates, make sure you add the "ALL" keyword (use UNION SELECT ALL rather than just UNION SELECT).

    If this isn't an issue in your application, nevermind. <img src=/S/toilet.gif border=0 alt=toilet width=24 height=26> I just didn't want to see you get bitten by this caveat.

    - Dayton - 08/31/2001 @ 09:36:09

Posting Permissions

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