Skip to content
Advertisement

Access SQL update a field with the value that subtracted two fields

I have a function at the end of the program that summed the numbers. I’m trying to subtract the GrandPrice with another field called Discount.

UPDATE INV_Headers SET
    GrandTotal = GrandTotal - Discount,
WHERE DocID = "xxxx"

But the error message (Syntax error in UPDATE statement access) just popped-up, how do I update a field by subtracting the field with another?


EDIT: This question is due to a typo

Advertisement

Answer

Remove comma,, if you want to update two column then use that comma , :

UPDATE INV_Headers 
     SET GrandTotal = GrandTotal - Discount
WHERE DocID = "xxxx"
User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement