We help IT Professionals succeed at work.
Get Started

Ms Access SQL - Update using 1 to Many relationship

andyb7901
andyb7901 asked
on
437 Views
Last Modified: 2008-09-19
Afternoon,
Can someone tell me how I would update my records in one table where the ID I am joining on appears multiple times in its corresponding realtionship table. The query I am using is;

UPDATE tbl_Artemis
INNER JOIN tbl_Unique_SPN_Trades ON tbl_Artemis.[Client SPN Number] = tbl_Unique_SPN_Trades.spn_id
SET tbl_Unique_SPN_Trades.[Sales Person] = [tbl_Artemis].[Person Name], tbl_Unique_SPN_Trades.Team = [tbl_Artemis].[Team Name - Level 1]
WHERE (((tbl_Unique_SPN_Trades.[Exclusion Type])=0));

Problem is SPN appears quite a few times in one table but I only really want to say update table, where ID's match but group by SPN in the second table so i only see the last entry under that ID?

I hope this makes sense?
Comment
Watch Question
Commented:
This problem has been solved!
Unlock 1 Answer and 7 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE