all of the documents after a given date. I do this where I want all of the documents with the [CompletedDate > " + dString + "] where dString is (today - 30 days)
I then run my query through a view
var vw:NotesView = thisAppDB.getView("vwFTSearch")
var n:Integer = vw.FTSearchSorted(qString, 0 , "SortBy" , false, false, false, false );
the vwFTSearch selects only documents with the form = "SomeForm" so if the DB contains a lot of documents with different form names you can simplify the search, also the FTSearch will fail if CompletedDate is null, so I populate the field with a known very early date which I call blankDate and I use (1/1/1970) , the view also contains a column which I call SortBy so the returned documents in the view are sequenced.
and vw contains only the documents selected so you only have to work with docs that meet your selection criteria. My query actually has about 10 different selection statements. I then work through the view and build a sessionScope variable that contains the UNID of each of the documents, I do this because I need to do some reordering of the documents. The use the sessionScope variable as the dataSource for a repeat control. Sound more difficult than it really is. I have tested where the return list is over 1000 documents and it works great. In the actual production DB I doubt the list will be more than 100.
In any case I would I would think that doing this by @Formula would be less than optimal performance wise.