Scratching my head...
Why should you NEED to "update a single number"? Why can't/shouldn't you just get that number from data that's already *IN* the database??
And if there is only a "single number", then why is there such a thing as "most recent number"??
In any case, you should never update something by hand that can, instead, be derived from data in the DB.
Can you show us your DB schema?? All the relevant fields of all the relevant tables??
Conceptually, this is trivial, but I am really afraid there is something badly messed up with the DB design.
You could use SQL to get the most recent record:
Code:
SELECT ID, SubmitDate, DayCount
FROM table
WHERE SubmitDate = ( SELECT MAX(SubmitDate) FROM table )
Or, if the ID field is an autonumber field,
Code:
SELECT ID, SubmitDate, DayCount
FROM table
WHERE ID = ( SELECT MAX(ID) FROM table )
Or, depending on what DB your are using (yes, it matters)
Code:
SELECT TOP 1 ID, SubmitDate, DayCount
FROM table
ORDER BY ID DESC
or
Code:
SELECT TOP 1 ID, SubmitDate, DayCount
FROM table
ORDER BY SubmitDate DESC
or or or ...
But it's not clear to me why you should be updating
DayCount manually, at all.