Update query with two conditions

MikeLeBen

Still struggling
Local time
Today, 21:02
Joined
Feb 10, 2011
Messages
187
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.
 
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?
 
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 :/
 

Users who are viewing this thread

Back
Top Bottom