PDA

View Full Version : need to run a update query and increment field by 1



keek2a4
12-06-2007, 06:18 AM
I have a table called tblProducts. Within the table I have a field called versionNumber. I want to update the version number to increment by one each time I run a query.

So if the version number is 1 after running the query it becomes 2. So far I have done the following:

CurrentDb.Execute "UPDATE tblProducts
SET tblProducts.versionNumber = "Need to increment by one, don't know how to"
FROM tblProducts;"

Please advice me how to implenent the Update query.

Thanks,
Ket

keek2a4
12-06-2007, 07:40 AM
Hi! I have managed to sort it out, Heres the solution I came up with:

CurrentDb.Execute "UPDATE tblProducts
SET tblProducts.versionNumber = tblproducts.versionnumber + 1;"

Thanks

DarkSprout
12-11-2007, 07:03 AM
[SQL Query]

UPDATE tblProducts SET tblProducts.versionNumber = [versionNumber] + 1;