Update query erroe 3144

  • Thread starter Thread starter Jeffiec via AccessMonster.com
  • Start date Start date
J

Jeffiec via AccessMonster.com

Trying to run a simple update query,

mysql = "UPDATE tblbintemp " & _
"SET tblbintemp.avge = " & "'" & targ & "'" & _
", SET tblbintemp.llim = " & "'" & llim & "'" & _
", SET tblbintemp.hlim = " & "'" & hlim & "'"

this is what it looks like in locals window

"UPDATE tblbintemp SET tblbintemp.avge = '1.15145833333333', SET tblbintemp.
llim = '0.08', SET tblbintemp.hlim = '1.58'"

Looks ok to me, why the error?
Thanks in advance
Jeff
 
Your use of single quotes indicates that the value is a string, but it
appears that the field should be typed as a number (single or double). It's
probably a data type conflict of some sort.
 
it funny, now all of a sudden im getting a 3075 error, even though the string
says,
"UPDATE tblbintemp SET avge =1.19729166666667 SET llim =0.73 SET hlim =2.62"
(i removed the quotes to make them numbers to try it)
the error says; "Missing operator" and this is what it shows;
'1.19729166666667 SET llim =0.73 SET hlim =2.62'
as if it didnt see anything after the middle of this line.
" SET avge =" & targ & _
like all it sees is this
" SET avge ="
leaving the variable out in the open.
Can i not use a variable in an update statement?
like above, the string shows it all fine, but the query wont see anything
after the "&" for the first varible.
this is the new code
mysql = "UPDATE tblbintemp " & _
" SET avge =" & targ & _
" SET llim =" & llim & _
" SET hlim =" & hlim

Thanks
Jeff
Your use of single quotes indicates that the value is a string, but it
appears that the field should be typed as a number (single or double). It's
probably a data type conflict of some sort.
Trying to run a simple update query,
[quoted text clipped - 11 lines]
Thanks in advance
Jeff
 
I think you need to add a comma in between each SET command and a semi-colon
at the end of the entire statement.
it funny, now all of a sudden im getting a 3075 error, even though the string
says,
"UPDATE tblbintemp SET avge =1.19729166666667 SET llim =0.73 SET hlim =2.62"
(i removed the quotes to make them numbers to try it)
the error says; "Missing operator" and this is what it shows;
'1.19729166666667 SET llim =0.73 SET hlim =2.62'
as if it didnt see anything after the middle of this line.
" SET avge =" & targ & _
like all it sees is this
" SET avge ="
leaving the variable out in the open.
Can i not use a variable in an update statement?
like above, the string shows it all fine, but the query wont see anything
after the "&" for the first varible.
this is the new code
mysql = "UPDATE tblbintemp " & _
" SET avge =" & targ & _
" SET llim =" & llim & _
" SET hlim =" & hlim

Thanks
Jeff
Your use of single quotes indicates that the value is a string, but it
appears that the field should be typed as a number (single or double). It's
[quoted text clipped - 5 lines]
 
when i add the commas, i get the original3144 error!
I think you need to add a comma in between each SET command and a semi-colon
at the end of the entire statement.
it funny, now all of a sudden im getting a 3075 error, even though the string
says,
[quoted text clipped - 24 lines]
 
Try creating a visual update query with the same fields and data (make a
copy/backup of course). Does it work? Can it run? If so, change the query
to SQL view and compare it to your statement. If it doesn't work, then
there's probably a problem with data types or the data table. I'm sorry I
can't help with the error message numbers.
when i add the commas, i get the original3144 error!
I think you need to add a comma in between each SET command and a semi-colon
at the end of the entire statement.
[quoted text clipped - 4 lines]
 
Too many Set. Also, you do realize that this will update EVERY record in
the table.

UPDATE tblbintemp
SET avge =1.19729166666667
, llim =0.73
, hlim =2.62


Jeffiec via AccessMonster.com said:
it funny, now all of a sudden im getting a 3075 error, even though the
string
says,
"UPDATE tblbintemp SET avge =1.19729166666667 SET llim =0.73 SET hlim
=2.62"
(i removed the quotes to make them numbers to try it)
the error says; "Missing operator" and this is what it shows;
'1.19729166666667 SET llim =0.73 SET hlim =2.62'
as if it didnt see anything after the middle of this line.
" SET avge =" & targ & _
like all it sees is this
" SET avge ="
leaving the variable out in the open.
Can i not use a variable in an update statement?
like above, the string shows it all fine, but the query wont see anything
after the "&" for the first varible.
this is the new code
mysql = "UPDATE tblbintemp " & _
" SET avge =" & targ & _
" SET llim =" & llim & _
" SET hlim =" & hlim

Thanks
Jeff
Your use of single quotes indicates that the value is a string, but it
appears that the field should be typed as a number (single or double).
It's
probably a data type conflict of some sort.
Trying to run a simple update query,
[quoted text clipped - 11 lines]
Thanks in advance
Jeff
 
Thanks for the help, that was it, too many "Set" statements.
BTW, I know it will update all records, there is only one, it holds data for
a Historagram and replaces data in that table so i can run it dynamicly.
Jeff

John said:
Too many Set. Also, you do realize that this will update EVERY record in
the table.

UPDATE tblbintemp
SET avge =1.19729166666667
, llim =0.73
, hlim =2.62
it funny, now all of a sudden im getting a 3075 error, even though the
string
[quoted text clipped - 31 lines]
 
Back
Top