If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Access > Get one Field from Backup dB, add to another!

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-31-12, 17:18
RBusiness RBusiness is offline
Registered User
 
Join Date: Aug 2010
Posts: 87
Get one Field from Backup dB, add to another!

Hello,

I noticed that I made a small error in a query that resulted in one field of data getting slightly messed up. I need to get the entire column from my backup dB and put it in my heavily edited dB table.

If I restore, then I will loose unkown amount of changes so I'm hoping to swap fields out! The sort order on everything is unchanged.

Is there an easy way to do this?
Reply With Quote
  #2 (permalink)  
Old 02-01-12, 04:43
healdem healdem is online now
Jaded Developer
 
Join Date: Nov 2004
Location: out on a limb
Posts: 9,250
import the table from the old db into the current db
then run and update query
Code:
UPDATE [one big table] SET mycolumn = othertablename.mycolumn
WHERE othertablename.acolumn = [one big table].acolumn
providing there is a unique reference that is the same in both tables that should work. that unique reference should replace acolumn.

the way this works is that you tell the SQL engine to replace the value of mycolumn with t he value form the othertable where there is a match between the a column values. if you need more than one column to identify a row uniquely then
Code:
WHERE othertablename.acolumn = [one big table].acolumn
 AND othertablename.bcolumn = [one big table].bcolumn
 AND othertablename.ccolumn = [one big table].ccolumn
repalce the mycolumn, othertablename, a column etc with your own table /column names
__________________
I'd rather be riding my Versys or my Tiger 800 let alone the Norton
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On