Skip to content
Advertisement

How do you update multiple rows in one column in a query?

In my table I have a column called test3 which has 8 rows in it, values ranging from 6 to 9, I am trying to use an UPDATE statement in SQL to update all of the rows in test3 but it doesn’t seem to update any of them when I try

enter image description here

Here is my SQL statement

UPDATE [Question1]
SET test3=test3+1
WHERE pupilID>0;

Advertisement

Answer

If this query:

UPDATE [Question1]
SET [test3]=[test3]+1

don’t work then can you edit the fields manually?

If your access database accdb/mdb file is read-only then it’s impossible to perform a write operation on it.

To enable updating of records in the database again you have to firstly remove the ReadOnly attribute.

if you can’t then select your mdb or accdb file and then make a right-click over it and choose the properties option.In the properties window, uncheck the ReadOnly checkbox.

Also, if you’re using Access workgroup security, you may not have rights to edit the data. In this case, login as the administrator or with a user name and password that gives you the appropriate rights.

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement