View Full Version : Query: Query with same field twice.


neiljw24
08-25-2009, 06:43 AM
There is probably an easy and obvious answer to this but i can't work it out.

I have an invoice Table that directly refers to an employee table twice. I.e. In the Invoive Table i know who opened the invoice and also who closed it.

However this info is shown as emploee ID which is a no and i was wondering how do i write a query that will show the names of the employees who both opened and closed the invoice.

When i try putting the employee name in the query (for both opening and closing fields) instead of their employee No all the records are repeated.

Any help would be much appreciated.
Thanks

namliam
08-25-2009, 06:49 AM
How about simply adding the empoyee table twice and joining on the seperate fields?

You can then add an "alias" to the names by adding it in the query design
Instead of the column having simply "Name" you would do "Alias: Name" and the column is now called Alias instead of name :)
This enables you to have 2 times the same column for different values :) If you understand what I mean

PS, Welcome to AWF

neiljw24
08-25-2009, 07:38 AM
Thank you very much namliam.

It worked perfectly.

And thanks for the welcome:)