Merge different queries

A

Andreas

Hello all,

I have two tables where I enter my stock trades as well as foreign
exchange (FX) trades. The two tables contain different fields as the
trading instruments require different entries. I then created two
seperated queries in order to calculate the profit from each stock and
each FX trade. I need two queries as the calculations are different,
too.

Now, I would like to merge the two queries in order to see my overall
profit and losses no matter if the trade is a stock or FX trade. That
is, in the final query I would like to see the trade ID (which is the
primary key in each table), the security's name as well as the profit
and loss from each trade.

I really have no idea how to merge my two queries. I think I should
mention that I am an MS Access 2007 newbie.

Any hints??

Regards,
Andreas
 
T

techrat

The quick hint would be to look at the help section or google Union
queries which can combine the results of two unrelated tables (having
the same number of fields).

The trick in your case is to get both queries that you are joining to
have the same number of fields.

You may want your 2 queries to have fields something like:
Trade Id
Trade Source: (Stock Trade or FX)
Profit (Expressed as positive or negative number)

If you get each query down to these 3 columns you can combine the
results with a union query.

There are other manipulations you can do to force both queries to have
the same number of columns but the above seems the simplest approach
to get what you are after.

HTH
 

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