Collecting and comparing date fields

Hello,

I am working on an agent to fix a bug where the completion date of many documents were set incorrectly.

I need to get a collection of Dates from a set of documents (collected by ID) and set the Completion Date to the most recent date of the collection.

I have my collection of documents that I want to work with, but I’m not sure how compare the dates to each other since they are the same field and I don’t know how many documents will be in each set.

Can anyone point me in the right direction?

Subject: DateTimeObject?

I would create a NotesDateTime object, and for each document in the collection you process, you set the date to the completion date in the document, if the date is greater than the existing date.

After you processed all the documents, you can just get the Date and use StampAll to update the documents.

Subject: Thanks

Thank you for your help!