Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Importing Same Records & Updating Fields

Status
Not open for further replies.

leadpro

Technical User
Jan 7, 2005
34
0
0
US
I'm sending out records for people to edit. After they edit, I want to take these records, match them up by ID, and update the appropriate fields to the new data.

?
 
basic syntax...

UPDATE MYTABLE SET field1='userval1', field2='userval2'
WHERE ID=userID

-DNG
 
thank you, but I don't think I was clear.

Clients send me back the edited records in excel, I import them back into the same table, or maybe a temp table, then append?

Thanks,
GLO
 
so lets say you import them to a temp table...now you have to do a update on your original table with new values from temp table...

is that right??

-DNG
 
a temp table, then update

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Yes to this:

so lets say you import them to a temp table...now you have to do a update on your original table with new values from temp table...

is that right??
 
ok then you need query which looks something like this...

UPDATE mytable INNER JOIN temptable ON
mytable.ID = temptable.ID
SET mytable.field1 = temptable.field1,
mytable.field2 = temptable.field2;


and so on...

hope this helps...

-DNG
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top