By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,188 Members | 1,023 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,188 IT Pros & Developers. It's quick & easy.

Update Query failing to update field data in table.

MitchR
P: 63
Good Morning;

I have an issue that I need to guidance to resolve. I have a table called return_tbl with about 25k records. I have 23 Fields in this table. I am looking to update 3 of these 23 fields: Manager, email, and phone_num. 80% of these 25k have old data that needs to be updated in the Manager, email, and phone_num fields. I have used a MkTBL query to gather the updated data and place it into a table called out. My out table is equipped with 4 fields: Serial_num, supervisor, email, and phone. My goal is to match the serial_num in both tables and update the pre-existing data in the fields for supervisor, email, and phone. I have created an update query to complete the update. But when I run the update query it does not update my data. Here is my SQL view of my query:

Expand|Select|Wrap|Line Numbers
  1.  
  2. UPDATE out INNER JOIN return_tbl ON out.[Serial #] = return_tbl.serial_num SET out.Supervisor = out.supervisor, out.Email = out.email, out.Phone = out.phone;
  3.  
May 17 '07 #1
Share this Question
Share on Google+
4 Replies


MitchR
P: 63
I made a change from [Serial #] to [Serial_num]. I answer yes to update the records and then ... Nothing.... here is my updated SQL view,
Expand|Select|Wrap|Line Numbers
  1. UPDATE out LEFT JOIN return_tbl ON out.Serial_num = return_tbl.serial_num SET out.Manager = out.manager, out.Email = out.email, out.Phone_num = out.phone_num;
  2.  
Thank you in advance for your help ....
May 17 '07 #2

Rabbit
Expert Mod 10K+
P: 12,366
I made a change from [Serial #] to [Serial_num]. I answer yes to update the records and then ... Nothing.... here is my updated SQL view,
Expand|Select|Wrap|Line Numbers
  1. UPDATE out LEFT JOIN return_tbl ON out.Serial_num = return_tbl.serial_num SET out.Manager = out.manager, out.Email = out.email, out.Phone_num = out.phone_num;
  2.  
Thank you in advance for your help ....
well... right now you're setting out.manager = out.manager. So basically you're setting itself equal to itself.
May 18 '07 #3

MitchR
P: 63
Wow, Batting 1000 here. I have made the changes to my Query and I have not had any luck cracking this thing. Would you look over the code for me ?
Expand|Select|Wrap|Line Numbers
  1. UPDATE out LEFT JOIN return_tbl ON out.Serial_num = return_tbl.serial_num SET out.Manager = return_tbl.manager, out.Email = return_tbl.email, out.Phone_num = return_tbl.phone_num;
  2.  
--------------------------------------------------------------------------------


Thank you so much !
May 18 '07 #4

Rabbit
Expert Mod 10K+
P: 12,366
Wow, Batting 1000 here. I have made the changes to my Query and I have not had any luck cracking this thing. Would you look over the code for me ?
Expand|Select|Wrap|Line Numbers
  1. UPDATE out LEFT JOIN return_tbl ON out.Serial_num = return_tbl.serial_num SET out.Manager = return_tbl.manager, out.Email = return_tbl.email, out.Phone_num = return_tbl.phone_num;
  2.  
--------------------------------------------------------------------------------


Thank you so much !
What is it doing now?

Try using an INNER JOIN instead.
May 18 '07 #5

Post your reply

Sign in to post your reply or Sign up for a free account.