update a table

rinova

Registered User.
Local time
Today, 12:58
Joined
Aug 27, 2012
Messages
74
I need some help with copying/updating data from a database table to another.
Details:
I have a MS Access table containing Dependent social security numbers but some of the dependents social security numbers are blank.
I have a MS Sql Database that contains a table with most of the missing MS Access table dependents Social Security numbers.
How can I take the Dependents social security number from MS Sql Database and copy/update the MS Access table.
I tried the sql code below created from MS Access and it matches 453 records out of 460 dependent social security numbers but how do I update qryGHIAccuracyFile_MissingDepSSN.SSN with the social security number from dbo_depfile1.dep_depend_ssn
Code:
 SELECT dbo_depfile1.dep_depend_ssn, qryGHIAccuracyFile_MissingDepSSN.SSN
 FROM qryGHIAccuracyFile_MissingDepSSN LEFT JOIN dbo_depfile1 ON qryGHIAccuracyFile_MissingDepSSN.MemberSSN = dbo_depfile1.dep_ss_nbr
 WHERE (((dbo_depfile1.dep_first)=[FirstName]) AND ((dbo_depfile1.dep_last)=[LastName]));
Can anyone help me with updating MS Access table dependent blank SSN’s with SSN in MS Sql Database.
Thanks,
Rich
 
I think I figured it out. I used the Sql Code below and it worked. I also used this http://office.microsoft.com/en-us/access-help/update-data-by-using-a-query-HA010076527.aspx#BM5 to help me as well.

Code:
UPDATE [Test tblGHIACCURACYFILE] LEFT JOIN dbo_depfile1 ON [Test tblGHIACCURACYFILE].MemberSSN = dbo_depfile1.dep_ss_nbr SET [Test tblGHIACCURACYFILE].SSN = [dbo_depfile1].[dep_depend_ssn]
WHERE ((([Test tblGHIACCURACYFILE].SSN) Is Null) AND ((dbo_depfile1.dep_last)=[LastName]) AND ((dbo_depfile1.dep_first)=[FirstName]));
Thanks,
Rich

SELF HIGH FIVE :D
 

Users who are viewing this thread

Back
Top Bottom