From: John on 29 Mar 2010 16:42 I need to find employees names that show up in two tables (duplicates). I have a table called Did Not Receive Gift Card and a table called Tax List (the table names are saved with the spaces exactly as shown). I need to find employees whose name is on the Did Not Receive Gift Card table AS WELL AS on the tax list table. Both tables use the field of name. This field is the employees full name. I did not set up the table this way, I inherited it so I cannot change it now. In essence what I am looking for are those employees who did not receive a gift card (Name on Did Not Receive Gift Card table) but were taxed for a card in their pay (name also on Tax List table). An office mate suggested a Join Query, but not sure how to write such.
From: Steve on 29 Mar 2010 17:12 Hello John, Create a query that includes both tables. In the query, join the Name field of both tables. The query will return the names that are in both tables. Steve santus(a)penn.com "John" <John(a)discussions.microsoft.com> wrote in message news:F79EFC9C-1C6B-4509-A98F-3E742D3D2743(a)microsoft.com... >I need to find employees names that show up in two tables (duplicates). I > have a table called Did Not Receive Gift Card and a table called Tax List > (the table names are saved with the spaces exactly as shown). I need to > find > employees whose name is on the Did Not Receive Gift Card table AS WELL AS > on > the tax list table. Both tables use the field of name. This field is the > employees full name. I did not set up the table this way, I inherited it > so I > cannot change it now. In essence what I am looking for are those employees > who did not receive a gift card (Name on Did Not Receive Gift Card table) > but > were taxed for a card in their pay (name also on Tax List table). An > office > mate suggested a Join Query, but not sure how to write such.
From: Dorian on 29 Mar 2010 17:50 You can do an inner join but there is nothing to prevent different people having the same name (its very common) so I would not use the name. You really need a unique key. SELECT A.Name FROM A INNER JOIN B ON A.Name = B.Name; -- Dorian "Give someone a fish and they eat for a day; teach someone to fish and they eat for a lifetime". "John" wrote: > I need to find employees names that show up in two tables (duplicates). I > have a table called Did Not Receive Gift Card and a table called Tax List > (the table names are saved with the spaces exactly as shown). I need to find > employees whose name is on the Did Not Receive Gift Card table AS WELL AS on > the tax list table. Both tables use the field of name. This field is the > employees full name. I did not set up the table this way, I inherited it so I > cannot change it now. In essence what I am looking for are those employees > who did not receive a gift card (Name on Did Not Receive Gift Card table) but > were taxed for a card in their pay (name also on Tax List table). An office > mate suggested a Join Query, but not sure how to write such.
|
Pages: 1 Prev: Really slow procedure A2007 ADO Next: Maintain the same number in a spreadsheet |