Wrox Programmer Forums
|
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 11th, 2004, 11:09 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 126
Thanks: 5
Thanked 0 Times in 0 Posts
Default Combine queries

Good morning!
I have several queries that I want to create a new query from, but not a normal query.
What I want the query to do is pull all the records from all tables and list them kind of like one big table. All the fields in each table are named identical. The only reason I have them in separate tables, is that I want the autonumber field to start over each year. So I have a table for each year.
For instance:
The field names are reportnumber, initiator, date, title...and so on.
Query 1
02-0001 J. Doe 1/3/02 Scrap report
02-0002 D. Miller 4/7/02 Cost reduction report

Query 2
03-0001 J. Doe 6/3/03 Engineering theories
03-0002 D. Miller 8/24/03 Lean Implementation

New Query (This is what I am wanting to know how to do)
02-0001 J. Doe 1/3/02 Scrap report
02-0002 D. Miller 4/7/02 Cost reduction report
03-0001 J. Doe 6/3/03 Engineering theories
03-0002 D. Miller 8/24/03 Lean Implementation

Not like this
02-0001 J. Doe 1/3/02 Scrap report 03-0001 J. Doe 6/3/03 Engineering theories
02-0002 D. Miller 4/7/02 Cost reduction report 03-0002 D. Miller 8/24/03 Lean Implementation

Any help would be greatly appreciated.


Regards,
Laura

The only thing standing between you and your goal is doubt. Quit doubting yourself and you'll be able to accomplish anything!
__________________
Regards,
Laura

The only thing standing between you and your goal is doubt. Quit doubting yourself and you'll be able to accomplish anything!
 
Old May 11th, 2004, 11:20 AM
sal sal is offline
Friend of Wrox
 
Join Date: Oct 2003
Posts: 702
Thanks: 0
Thanked 0 Times in 0 Posts
Default

select * from table 1

union
select * from table2

Read up on "union" and "union all" first.



Sal
 
Old May 11th, 2004, 11:38 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 126
Thanks: 5
Thanked 0 Times in 0 Posts
Default

Exactly what I was looking for!

Thanks for the quick reply!

Regards,
Laura

The only thing standing between you and your goal is doubt. Quit doubting yourself and you'll be able to accomplish anything!





Similar Threads
Thread Thread Starter Forum Replies Last Post
Combine two queries snufse SQL Server 2005 6 June 24th, 2008 09:42 PM
Combine sql queries snufse SQL Server 2005 16 June 17th, 2008 03:47 PM
Help: Need to combine multiple IF queries scotts SQL Server 2005 1 April 14th, 2008 07:54 PM
Combining Queries or results from 2 queries Ford SQL Server 2000 24 November 7th, 2005 08:54 PM
combine 2 queries collie SQL Server 2000 2 November 29th, 2004 03:09 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.