Joining results from 2 querys

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have 2 querys which create fields A B C D E from different sources of
information

I have formated the output of the querys to match my needs, however would
like to join the two queries into one master list

Can this be done ... if so how ??

Many thanks in advance
 
I have managed to achieve this by calling vba code and SQL using a sequence
of Make table and append queries, however now ask the question is there a way
to disable the prompts generated by access or even respond to them within the
vba code ???
ultimately Looking to create a button that will do sequence of queries and
output the file as a .csv or .xls without any further prompt to the user

Many thanks again
 
Alan said:
I have 2 querys which create fields A B C D E from different sources of
information

I have formated the output of the querys to match my needs, however would
like to join the two queries into one master list

Can this be done ... if so how ??

Many thanks in advance

Hi Alan

Use a union query:

SELECT A, B, C, D, E FROM tblFirstTable
UNION
SELECT A, B, C, D, E FROM tblSecondTable;

the above will exclude duplicate rows, to include use UNION ALL

Regards - Joe
 
Alan said:
I have managed to achieve this by calling vba code and SQL using a sequence
of Make table and append queries, however now ask the question is there a way
to disable the prompts generated by access or even respond to them within the
vba code ???
ultimately Looking to create a button that will do sequence of queries and
output the file as a .csv or .xls without any further prompt to the user

Many thanks again

Hi Alan

Look up SetWarnings in the Help

Regards - Joe
 
Alan said:
I have 2 querys which create fields A B C D E from different sources of
information

I have formated the output of the querys to match my needs, however would
like to join the two queries into one master list

Can this be done ... if so how ??


It probably can be done, but how depends on what you
mean by "join the two queries into one master list"

Just guessing now, but maybe you just want to use:

SELECT a,b,c,f,e FROM query1
UNION ALL
SELECT a,b,c,f,e FROM query2

Note that you can not create a UNION query using the query
design grid, you must switch to SQL view to do it.
 
Back
Top