Problem filtering a simple query! (1 Viewer)

NewShoes

Registered User.
Local time
Today, 01:03
Joined
Aug 1, 2009
Messages
223
Hey all,

Probably a bit of a newbie question but I have a very simple query that I cannot filter!

I basically have 1 table that the query works on. It is the Employee table and I would like to query for Employee and Line Manager, this works fine but when I add a criteria of [Please enter Managers Name:] to the Manager field, it doesn't work. I believe this is becase I have used normalisation and lookup the managers name from a Managers table (using a query).

I believe the problem is that the Employee table holds the ID of the manager (it's bound to ManagersID), rather than the manager name (tho I was led to believe that this is the way it should be with regard to normalisation).

Is this a problem or is this what normalising your database does? and either way, how can I filter it on managers name?

Thanks,
-NS
 

G81

Registered User.
Local time
Today, 09:03
Joined
Jun 10, 2010
Messages
73
its not a problem, its because the names are in a different table. All you have to do is an inner join. So if you have a table:

Code:
employee | ManagerID
and another table with:

Code:
managerid | managername
to select the employee and managername it is:

Code:
SELECT tblemployee.employee, tblmanager.managername
FROM tblemployee
INNER JOIN tblmanager ON tblemployee.managerid = tblmanager.managerid

Thats the same as having an access select query with both tables and joining the manager id from both tables (click and drag).
 

G81

Registered User.
Local time
Today, 09:03
Joined
Jun 10, 2010
Messages
73
by the way when you put your where clause with an input field like that, be wary. If you dont spell it the same or have an extra space before or after the search string it wont return anything.

You could always modify the where clause to have a like operator, wildcard characters and a trim function to fix those problems if it becomes a major issue
 

Users who are viewing this thread

Top Bottom