M MikeLeBen Still struggling Local time Today, 17:56 Joined Feb 10, 2011 Messages 187 Apr 18, 2011 #1 Do you see why I get a "Syntax error" when I try to run this SQL instruction? UPDATE Clienti_Ricette SET Residuo = Residuo - 46,48 WHERE Residuo >= 46,48 AND IDCliente = 472 The WHERE part gets highlighted.
Do you see why I get a "Syntax error" when I try to run this SQL instruction? UPDATE Clienti_Ricette SET Residuo = Residuo - 46,48 WHERE Residuo >= 46,48 AND IDCliente = 472 The WHERE part gets highlighted.
Brianwarnock Retired Local time Today, 16:56 Joined Jun 2, 2003 Messages 12,667 Apr 18, 2011 #2 Can we assume that the , is the Decimal indicator? Brian
M MikeLeBen Still struggling Local time Today, 17:56 Joined Feb 10, 2011 Messages 187 Apr 18, 2011 #3 Right! Since I'm running this from VBA with Code: mySQL = "UPDATE Clienti_Ricette " & _ "SET Residuo = Residuo - " & sforo & _ " WHERE [Residuo] >= " & sforo & _ " AND [IDCliente] = " & Me.IDCliente Debug.Print mySQL DoCmd.RunSQL mySQL and the variable "sforo" is the result of a DSum, how do I fix it?
Right! Since I'm running this from VBA with Code: mySQL = "UPDATE Clienti_Ricette " & _ "SET Residuo = Residuo - " & sforo & _ " WHERE [Residuo] >= " & sforo & _ " AND [IDCliente] = " & Me.IDCliente Debug.Print mySQL DoCmd.RunSQL mySQL and the variable "sforo" is the result of a DSum, how do I fix it?
M MikeLeBen Still struggling Local time Today, 17:56 Joined Feb 10, 2011 Messages 187 Apr 18, 2011 #4 I changed the variable types form currency to integers and that did the trick. Thank you so much I keep forgetting of the little nuisances of conversion between EU and US notation. Edit: Actually, no, that means the values are truncated and rounded to integers :/
I changed the variable types form currency to integers and that did the trick. Thank you so much I keep forgetting of the little nuisances of conversion between EU and US notation. Edit: Actually, no, that means the values are truncated and rounded to integers :/
Brianwarnock Retired Local time Today, 16:56 Joined Jun 2, 2003 Messages 12,667 Apr 18, 2011 #5 Happy to have helped, even if by default. Brian
M MikeLeBen Still struggling Local time Today, 17:56 Joined Feb 10, 2011 Messages 187 Apr 18, 2011 #6 ok I solved this with the replace function. Should anybody else be in the same waters I was in, check these links for refernece: http://www.tek-tips.com/viewthread.cfm?qid=1600948&page=2 http://www.techonthenet.com/access/functions/string/replace.php
ok I solved this with the replace function. Should anybody else be in the same waters I was in, check these links for refernece: http://www.tek-tips.com/viewthread.cfm?qid=1600948&page=2 http://www.techonthenet.com/access/functions/string/replace.php