chthomas
05-27-2003, 04:19 AM
Hi,
I have 2 queries with the same fields except the last 2 columns. If i want to build a 3rd query which also shows the last 2 columns of each of the queries, how to do that. I have included an attachment showing the query fields look like.
If i want to build query3 which apart from showing the common fields in query1 and query2, also combine the the last 2 columns of query1 and query2
Any suggesions?
dcx693
05-27-2003, 04:56 AM
When you say "combine" I assume you want to add them (not concatenate, since they're numeric).
Just create a field statement like this in your 3rd query to combine the last two columns of the 1st query:
[pr_bud_santal]+[pr_bud_bedra]
and do something similar for the second query. If you want, you can control what the column is named in your query like this:
newcolumn:[pr_bud_santal]+[pr_bud_bedra]
otherwise, Access will name the column for you calling it "Expr1" or something like that.
chthomas
05-27-2003, 05:13 AM
I think i confused you. I will make it simple. I don't want to add or concatenate. I want the last 2 columns of query2 appear at the end of query1. I saved both the queries as tables in my attachment.
Regards,
Charley
dcx693
05-27-2003, 06:02 AM
Yes, sorry, I was confused.
Create a new 3rd query and base it on the two queries you've already created. Go to create a new query. When you are presented with the "Show Table" dialog box, click on the "Queries" tab so you can choose queries to show in your new query. Choose the 1st and 2nd queries that you've already created. In the query window, join the two queries by the projcode field, that will ensure that the proper results get shown together. Then choose the fields you want to show in the query and run it.