Limiting JOIN to first match

dprichard

Registered User.
Local time
Today, 12:41
Joined
Jun 23, 2008
Messages
14
I have a query that does an inner join. I want it to just pull in the first match from the second table in the event there are multiple matches. How do I limit the query to only pull in the first match found for the rcust.CustID?

Thanks for any help. :confused::confused:

SELECT Mid(iusr_lu.UVAR, (InstrRev(iusr_lu.UVAR, " ") + 1)), iusr_lu.UFST, iusr_lu.ULST, iusr_lu.UNM, rcust.CustAdd1 INTO DSGTESTING
FROM iusr_lu INNER JOIN rcust ON Mid(iusr_lu.UVAR, (InstrRev(iusr_lu.UVAR, " ") + 1)) = rcust.CustID WHERE Not IsNull(iusr_lu.UVAR);
 
Do your records have any way to identify the "first match"?? A query by default is random thus the "first match" may change each time you run it...

Assuming you have a number or date you can use to identify the first, then make a query to find the first date/number and add that to your query, inner join it and done...
 

Users who are viewing this thread

Back
Top Bottom