URGENT!~*****First Match*****~URGENT!

L

Lost

I have two tables inwhich I am grouping by the First Match, hence I need all
values from #1 table matched to the corresponding #2 table if there is a
match , otherwise the field will be left blank.

When I run my query my duplicate records from my #1 table are being dropped.
I need to retain these duplicates. Please help!
 
K

KARL DEWEY

Use a LEFT JOIN. In design view with table1 left of table2, click on the
matching field of table1 and drag to table2 field. Double click on the
cennecting line and select the option to show all records from table1 and
only those of table2 that match.
 
J

Jerry Whittle

Show us the SQL. Open the query in design view. Next go to View, SQL View
and copy and past it here. Information on primary keys and relationships
would be a nice touch too.
 
L

Lost

Thanks Karl, I was able to do that however my question is after you use the
LEFT JOIN, my results suppress duplicate records. I need to see these
duplicate records.

Jerry my SQL is below:

SELECT Data.Div, Data.Loc, Data.Dept, Data.Class, Data.Item, Data.Desc,
Data.Price, First(Data2.UPC) AS FirstOfUPC
FROM Data LEFT JOIN Data2 ON (Data.Dept = Data2.Dept) AND (Data.Class =
Data2.Class) AND (Data.Item = Data2.Item)
GROUP BY Data.Div, Data.Loc, Data.Dept, Data.Class, Data.Item, Data.Desc,
Data.Price;

Again, my question is after applying the LEFT JOIN and finding the First
Match off the second data table, how to I show all the records on my output
(ie I need to see duplicate records)?

I am not using primary keys.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top