Updating Multiple Fields in a Query

  • Thread starter Thread starter Will Lastname
  • Start date Start date
W

Will Lastname

I am trying to update 2 fields in a database that match a certain
criteria. The SQL I am using is:

UPDATE tblProducts SET Version = "TEST" And Revision="T1,T2,T3"
WHERE (ID=119 And SheetNumber=0 And Product="H2600");

When I run this in Access it tells me that I am going to update 1 row.
So I know that it is partially working. The SQL executes in my
application and when the page is reloaded the value isn't the same.
Let's say that the original Revision is CD and I change to DJ. When the
page is refreshed I get -1 as the value. Any suggestions?
 
UPDATE tblProducts SET Version = "TEST" , Revision="T1,T2,T3"
WHERE (ID=119 And SheetNumber=0 And Product="H2600");

The syntax doesn't use AND. Fields to be updated are separated by a ','
(comma). It was taking the AND to be a bitwise operator.
 
Back
Top