473,387 Members | 1,535 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Update Query failing to update field data in table.

MitchR
65 64KB
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
4 1895
MitchR
65 64KB
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
12,516 Expert Mod 8TB
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
65 64KB
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
12,516 Expert Mod 8TB
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

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

Similar topics

2
by: skidvd | last post by:
Hello: I have just recently converted to using the InnoDB table type so that I can enforce FOREIGN key constraints. I have been using MyISAM tables (accessed via JDBC) successfully for some...
16
by: Philip Boonzaaier | last post by:
I want to be able to generate SQL statements that will go through a list of data, effectively row by row, enquire on the database if this exists in the selected table- If it exists, then the colums...
3
by: rrh | last post by:
I am trying to update a field in one table with data from another table. The problem I'm running into is I need to base the update on a range of data in the 2nd table. Table 1 has: date field...
2
by: Kelly Bowles | last post by:
I am doing something wrong, but I fail to see it. Access 2002 is what I am using. I have struggled with this for over two weeks. PurchaseOrder table/form linked to InventoryTransaction...
1
by: David Barger | last post by:
Greetings, It appears that an Append Query I run in Access XP is randomly failing to append a field. I have payroll data being entered into a payroll database. This data is exported daily to...
8
by: Maxi | last post by:
There is a lotto system which picks 21 numbers every day out of 80 numbers. I have a table (name:Lotto) with 22 fields (name:Date,P1,P2....P21) Here is the structure and sample data: ...
16
by: Ian Davies | last post by:
Hello Needing help with a suitable solution. I have extracted records into a table under three columns 'category', 'comment' and share (the category column also holds the index no of the record...
16
by: ARC | last post by:
Hello all, So I'm knee deep in this import utility program, and am coming up with all sorts of "gotcha's!". 1st off. On a "Find Duplicates Query", does anyone have a good solution for...
3
by: fperri | last post by:
I have a field in my main table called "CHANGE". Each week before we update the data we create a backup of the table and adjust the CHANGE field for all records to zero. I have an update query where...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.