Updating a boolean field

Maldrid

Registered User.
Local time
Today, 13:20
Joined
Jul 24, 2003
Messages
20
Updating a boolean field [Resolved]

Anyone know why this does not work?

Code:
sSQLQuery = "UPDATE BackOutBilling SET Report = " & True & " WHERE [KitchenID] = '" & sKitchen _
        & "' AND [Report] = " & False

The field Report is set up as a yes/no field.
 
Last edited:
You could try this one
Code:
sSQLQuery = sSQLQuery & "UPDATE BackOutBilling" & vbCrLf
sSQLQuery = sSQLQuery & "SET Report = True" & vbCrLf
sSQLQuery = sSQLQuery & "WHERE" & vbCrLf
sSQLQuery = sSQLQuery & "  KitchenID = '" & sKitchen & "' AND" & vbCrLf
sSQLQuery = sSQLQuery & "  Report = False" & vbCrLf

' check it in an empty query by copying the query out of the immediate window
Debug.Print sSQLQuery
KitchenID should in this case be a textfield.
 
Don't forget to put some spaces in between words in your SQL clause, though.


sSQLQuery = "UPDATE BackOutBilling SET [Report] = True WHERE [KitchenID] = '" & sKitchen & "' AND [Report] = False;"
 
Thanks for the replies guys. I got it to work. Thanks for the help!!
 

Users who are viewing this thread

Back
Top Bottom