Joining Tables and Quieries

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

Guest

I couldnt find an answer to this question, so I am asking for your help!

I have created a sales database to track two specific kinds of sales. I
have also created another database to log peoples sales goals in these two
areas.

My questions is I am trying to combine these so I can see how people are
doing in comparison with their goals on any given day of the year.
Potentiall to run monthly reports on how people are doing monthly and YTD.

Everytime I do this it duplicates data. For instance, I am tracking 11
branches of our company. Each branch has about 20 sale reps. If the branch
does one sale, when I run the report it shows that sale for everyone in the
branch. I am so lost!

Help if you can.
 
I will point out that we aren't there, can't see your table structure, don't
know if you are saying "database" when you mean "table", or much else.

If you want a more specific response, provide more specific background for
us to work with...
 
Sorry I guess I will try and leave a better question

I have 2 Databases. Database A I update daily with Sales Information. What
branch it came from, the person, type of sale, and amount of sale. This
database is only tracking two kinds of sales. Database B I have been using
just to imput peoples yearly Sales Goals with relation to our two sales from
Database A. I would like to combine or join these two databases in querie to
show the following

Branch Fname Lname Month Sale 1 Goal 1 Sale 2 Goal 2

This way each day or month I could see how sales reps in each branch are
doing towards their goals.

Thanks
 
Sorry I guess I will try and leave a better question

I have 2 Databases.

Are these two separate .mdb files, each a container for multiple
Tables, Forms, Reports, etc.? Or are they two Tables in one database?
Jeff has a good point: jargon is important if you want to communicate!
Database A I update daily with Sales Information. What
branch it came from, the person, type of sale, and amount of sale. This
database is only tracking two kinds of sales. Database B I have been using
just to imput peoples yearly Sales Goals with relation to our two sales from
Database A. I would like to combine or join these two databases in querie to
show the following

What is the Primary Key of each table?
Branch Fname Lname Month Sale 1 Goal 1 Sale 2 Goal 2

This table IS SIMPLY INCORRECT. You're "committing spreadsheet". Any
table with fields named Sale 1 and Goal 2 should be split into two
tables in a one to many relationship. If there are two kinds of sales
today, who's to say that the boss won't demand a finer division into
seven kinds tomorrow?

Secondly, using FName and LName as a unique identifier for a person is
very risky. I once worked in the same company as Dr. Lawrence David
Wise and his colleague, Dr. Lawrence David Wise. Your salespeople
should each have a unique ID, and you should have a table of
salespeople; the sales information table would have just the ID as a
link to this table (this will also help when a sales rep changes their
name, perhaps by marriage).

When you have this structure, then you should be able to create a
query joining the Goals table (you haven't described its structure) to
the Sales table, joining ID to ID and month to month.

John W. Vinson[MVP]
 
Back
Top