Building a Select Query (1 Viewer)

chthomas

Registered User.
Local time
Today, 03:37
Joined
Feb 8, 2000
Messages
32
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?
 

Attachments

  • query.jpg
    query.jpg
    59.4 KB · Views: 109

dcx693

Registered User.
Local time
Yesterday, 22:37
Joined
Apr 30, 2003
Messages
3,265
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

Registered User.
Local time
Today, 03:37
Joined
Feb 8, 2000
Messages
32
I confused you

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
 

Attachments

  • db1.zip
    8.3 KB · Views: 112

dcx693

Registered User.
Local time
Yesterday, 22:37
Joined
Apr 30, 2003
Messages
3,265
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.
 

Users who are viewing this thread

Top Bottom