Hi Louis,
The easiest way I can think of doing this is using 2 queries. (a select & an update query).
First, use your select query to find the record that you are looking for.
Then use the update query to update the data.
Something like.
MySelectQuery.pParam = sMyParam
HExecuteQuery(MySelectQry,hQueryDefault)
HReadFirst(MySelectQry)
While Hfound(MySelectQry)
sWhatToChange = iYear + MySelectQry.FIELD[[5 to]
nQryRecID = MySelectQry.RECID
MyUpdateQuery.vRecId = nQryRecID
MyUpdateQuery.pFIELD = sWhatToChange
HexecuteQuery(MyUpdateQuery,hQueryDefault)
HreadNext(MySelectQry)
...
Mind you, I wrote this directly into the editor, so there may be errors and I
didn't trap errors on the HexecuteQuery commands.
I'm not sure how many records you are doing this with nor how CPU intensive
this would be if there are lots of records. I like using the Windev Query editor
instead of SQL commands and its always pretty fast for me.
Georgio