Chris Allen
03-06-2011, 03:25 PM
Here is what i have... VS.NET / SQL Server 2005
Two tables: tblGenerators / tblCustomers
tblGenerators has a column tblGenerators.CustomerID (Stores a 4 charactor string i.e. 9999 which represents the customer account number)
tblCustomers has a column tblCustomers.CustomerID (is a unique RecID number) and tblCustomers.Account (4 charactor account number)
I want to convert(change) the tblGeneraotors.CustomerID( which stores a 4 charactor string i.e. 9999 which represents the customer account number) to the Unique rec id number from the customers table.
Below is the code I am attempting to use but having trouble.
Can someone tell me what I am doing wrong please.
I have have looked at W3 but minimal help there.
Dim qry As String = "Update tblgenerators "
qry += "SET tblgenerators.customerid = tblcustomers.customerid "
qry += "JOIN tblCustomers ON tblgenerators.customerid=tblcustomers.account "
qry += "WHERE ('tblgenerators.customerid' = tblcustomers.Customerid)"
Two tables: tblGenerators / tblCustomers
tblGenerators has a column tblGenerators.CustomerID (Stores a 4 charactor string i.e. 9999 which represents the customer account number)
tblCustomers has a column tblCustomers.CustomerID (is a unique RecID number) and tblCustomers.Account (4 charactor account number)
I want to convert(change) the tblGeneraotors.CustomerID( which stores a 4 charactor string i.e. 9999 which represents the customer account number) to the Unique rec id number from the customers table.
Below is the code I am attempting to use but having trouble.
Can someone tell me what I am doing wrong please.
I have have looked at W3 but minimal help there.
Dim qry As String = "Update tblgenerators "
qry += "SET tblgenerators.customerid = tblcustomers.customerid "
qry += "JOIN tblCustomers ON tblgenerators.customerid=tblcustomers.account "
qry += "WHERE ('tblgenerators.customerid' = tblcustomers.Customerid)"