Update all docs in a view without using a loop
Set view = db.GetView("viewname") Set entrycoll = view.AllEntries Call entrycoll.StampAll("fieldname", value)
However, if you're updating more than one field, it probably is more efficient to iterate through the documents using view.GetFirstDocument and GetNextDocument. Use view.AutoUpdate to prevent the view index from being updated while you do your loop; if you delete documents, your loop should pre-fetch the next document at the top of the loop.
If the column is the first sorted column in the view, they you can easily find the largest one using view.GetFirstDocument or GetLastDocument (depending whether the sort is ascending or descending).
Otherwise, the quickest way to iterate through a view looking for the maximum value is to use an entrycoll variable, as shown above, and iterate thru the rows examining the ColumnValues property. Using a view that's already sorted is a lot faster, so it might be worth while to have a hidden view with this sort, if for no other reason.
Macro language does not offer an efficient way to do either of these tasks. While @Max(@DbColumn(...)) will work in some cases, you still have to retrieve all the data in a column, and there's a limit to how much data @DbColumn can return.
Do you have comments on this Ask the Expert question and response? Let us know.