how would i combine three queries into one table

K

kris

Would anyone happen to know the best way for me to combine three queries into
one table. So far I got the best results from using an apennd query. The down
side is I can't use a macro to exicute them. I would like to use a macro in
order to automate this report gathering. Unless there is a better way of
course.

What I'm trying to do is grab two common fields (Group ID and Ticket Number)
out of my company's change control system so that I can produce a change
control report for my team. My team is identified in the system in three
ways. Audiance member, stake holder and implementor.
 
J

John Vinson

Would anyone happen to know the best way for me to combine three queries into
one table. So far I got the best results from using an apennd query. The down
side is I can't use a macro to exicute them. I would like to use a macro in
order to automate this report gathering. Unless there is a better way of
course.

What I'm trying to do is grab two common fields (Group ID and Ticket Number)
out of my company's change control system so that I can produce a change
control report for my team. My team is identified in the system in three
ways. Audiance member, stake holder and implementor.

It sounds like a single query should work, if these are three values
of one field. Are you using one query to find "Audience Member",
another to find "Stake Holder", etc.? If so, consider using a
criterion

IN ("Audience Member", "Stake Holder", "Implementor")

and base your report directly on this query. Making a new Table is
almost certainly unnecessary, and will just slow things down and bloat
your database!

John W. Vinson[MVP]
 
K

kris

I actually simplified the question a bit. Sorry if I took this conversation
way off base. I think I simplified it to much. Language is funny isn't it. :)

Anyway, I'm pulling the original information from a DB2 database on a
mainframe using ODBC. The Audience Member, Stake Holder and Implementer
information I'm pulling from are three different tables in DB2. The fields in
those I'm interested in are the same though. Group ID and Ticket Number.
Because my group is sometimes all three and at other times just one I'm
having problems with duplication. That's why I was dumping info into a table.
By dumping into a table I solved two problems. One problem was ticket number
duplication. I simply set the ticket number field to not allow duplication.
The other issue the table resolved was it gave me a ticket number and group
identifier list to compare to another table with. In that other table I have
the group id and ticket number info along with other unique information that
I do want to allow duplication with such as the hardware name and IP,
business unit(s) and application(s) being effected by the change. Also I'm
making the report available using the data access page. It's really pretty
nice and it worked great until I had to include multiple IT groups. Any help
would be greatly appreciated.
 
J

John Vinson

It's really pretty
nice and it worked great until I had to include multiple IT groups. Any help
would be greatly appreciated.

Have you looked at a UNION query? It will automatically remove
duplicates without the need to create a temp table.

See the online help for UNION, or post back with more details if it's
not giving you what you need.

John W. Vinson[MVP]
 
K

kris

Funny you mentioned that. Between looking over other messages in this
newsgroup and using the Northwind model that Microsoft has out there I
figured that out. Yahoo what a rush! Thank you very much for your help. I
tell yea. This newsgroup is better then looking through the help files.
Nothing quit like interactive help. Also there's tons of ideas in here.
Thanks again!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top