M
Max Moor
Hi All,
I want to run an update query to concatinate one field in a table
onto another one, with a comma and space between them. This is the basic
SQL:
strSQL = "UPDATE tblMine SET tblMine.F1 = tblMine.F1 & ', ' & tblMine.F2;"
This works fine. The problem is that I don't know the names of the
columns (F1 and F2 in the example) until runtime. I tried the SQL:
strF1 = "F1"
strF2 = "F2"
strSQL = "UPDATE tblMine SET tblMine('" & strF1 & "') = tblMine('" & strF1
& "') & ', ' & tblMine('" & strF2 & "');"
but I get a syntax error. The error is in the attempted use of syntax
like:
tblMine("F1")
in the SQL. Obviously, I don't know what to do to make it better, though.
Can anyone set me back on the straight and narrow?
Thanks, Max
I want to run an update query to concatinate one field in a table
onto another one, with a comma and space between them. This is the basic
SQL:
strSQL = "UPDATE tblMine SET tblMine.F1 = tblMine.F1 & ', ' & tblMine.F2;"
This works fine. The problem is that I don't know the names of the
columns (F1 and F2 in the example) until runtime. I tried the SQL:
strF1 = "F1"
strF2 = "F2"
strSQL = "UPDATE tblMine SET tblMine('" & strF1 & "') = tblMine('" & strF1
& "') & ', ' & tblMine('" & strF2 & "');"
but I get a syntax error. The error is in the attempted use of syntax
like:
tblMine("F1")
in the SQL. Obviously, I don't know what to do to make it better, though.
Can anyone set me back on the straight and narrow?
Thanks, Max