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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Add data to specific records in an existing table field

Status
Not open for further replies.

michalla

Technical User
May 16, 2007
2
US
I have a table that contains several fields. Three of the fields are SSN, Background investigation type and investigation date. There about 20,000 records in the table. 75% of the existing records have these three fields completed with data. I received a new data dumb that contains 850 records. These 850 are already included in the existing table of 20,000 records. However, in the existing table, the investigation type and date field is bland. The new data dump contains the data to populate these two fields.

So, I need to lookup the SSN in the new data dump to find the same SSN in the initial table and update only the investigation type and date fields for the 850 reoords. I have been trying, with no success, to figure out a way to do this. Any help would be greatly appreciated.

Thanks in advance,

michalla
 
Perhaps something like this (SQL code):
UPDATE InitialTable AS I INNER JOIN NewDataDump AS N ON I.SSN = N.SSN
SET I.[Background investigation type] = N.[Background investigation type]
, I.[investigation date] = N.[investigation date]

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Thanks PH. Where would you place the code? In a query?
 
Yes, create a new query, switch from the Query Design Grid to the SQLView and paste the SQL. Edit the table and field names if necessary and run the query.


Leslie

Anything worth doing is a lot more difficult than it's worth - Unknown Induhvidual

Essential reading for database developers:
The Fundamentals of Relational Database Design
Understanding SQL Joins
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top