Access query with table reference

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

ChipT

Thread Starter
Joined
Jan 5, 2011
Messages
1
I have two tables. One with Customers down the side, and billcodes across the top. The table is populated by billcode quantities.

The second has table has two columns: Billcode and Rate. The table maps billcodes to their rates.

I want to construct a query that will multiply each billcode quantity by its rate to get revenue. How might this be constructed in Access?

Visually, here are the two tables:

Table 1:
| BC1 | BC2 |
CustA | 5 | 10 |
CustB | 3 | 8 |

Table 2:
Billcode | Rate |
BC1 | $1 |
BC2 | $2 |

Desired result:
| BC1 | BC2 |
CustA | 5 * $1 | 10 * $2 |
CustB | 3 * $1 | 8 * $2 |
 

OBP

Joined
Mar 8, 2005
Messages
19,895
ChipT, welcome to the Forum.
What you have described is what you do.
Create a Query for table 1 with the Customers and Bill codes.
Add table 2.
Add a new column, in the heading put the following
resultBC1: tablename1.[BC1] * tablename2.[BC1]
Add a new column, in the heading put the following
resultBC2: tablename1.[BC2] * tablename2.[BC2]

where tablename is the actual names of the 2 tables.

This Table structure is OK for data entry but far from ideal design wise. If you have to add a BC3 later you have to add fields to tables, queries, forms & reports.
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Staff online

Top