Please help, I have been searching all day and have nothing.
I am using SQL Server 2000 and VB6. I have a table (NAICSCodes) with 2 fields, (CODE) and (WORD). I want to Update a field(Industry) in another table(FileFromIRS) with the (CODE) from (NAICSCodes) when a 50 character field in
my input file contains the word or words in the (WORD) field of (NAICSCodes). I am very new to SQL and am feeling quite foolish. The code that I think should work is:
SQL = "UPDATE FileFromIrs SET Industry = (select code from NAICSCODES where Word like " & "%' & inputfield & '%" & "'"
I used the double and single quotes because VB says I have to .
I am using SQL Server 2000 and VB6. I have a table (NAICSCodes) with 2 fields, (CODE) and (WORD). I want to Update a field(Industry) in another table(FileFromIRS) with the (CODE) from (NAICSCodes) when a 50 character field in
my input file contains the word or words in the (WORD) field of (NAICSCodes). I am very new to SQL and am feeling quite foolish. The code that I think should work is:
SQL = "UPDATE FileFromIrs SET Industry = (select code from NAICSCODES where Word like " & "%' & inputfield & '%" & "'"
I used the double and single quotes because VB says I have to .