how to apply a view selection formula to a view, to get entries of particular date range say from date1 to date2.
How can the formula be applied to the view in Lotus Script.
how to apply a view selection formula to a view, to get entries of particular date range say from date1 to date2.
How can the formula be applied to the view in Lotus Script.
Subject: view selection formula
This is an area where you need to be very careful.Whatever you do, you should never ever have any form of computed dates in a view selection formula, as this will lead to the view constantly rebuilding its index and slowing down your database severely.
To enter hard-coded dates, just use square brackets around the dates, as in:
SELECT Form = “xxx” & date1 >= [01/01/07] & date2 <= [31/01/07]
Date-formats are dependent on the server’s settings, in the example above I used dd/mm/yy.
You can use LotusScript to change the selection formula for a view, see the notesView.SelectionFormula in the Designer help file for info.
Subject: RE: view selection formula
Whatever you do, you should never ever have any form of
computed dates in a view selection formula
I keep hearing that, but I don’t believe it. I’ve built any number of databases which have view selection formulas including @Now and @Date, and I get entirely acceptable performance out of them. Approach with caution, of course, but they can, depending on the application, be very useful.
You can use LotusScript to change the selection formula for
a view
Doesn’t the user need to have at least Designer access to the database for that to work?
Subject: RE: view selection formula
My experiences from having computed dates in view selection formulas are very different from yours. On really large databases where views need to show 50.000 docs or more you really see a huge difference. So I would certainly not recommend it.
The changing of the selection formulas must be done by someone with Designer or Manager access - yes.
But that’s easy to organise by having an agent signed by a Designer/Manager that can be invoked by certain other users.
Subject: Number of docs
I have only had one or two databases in my career that had over a few thousand documents. As such, the margin for error in performance is far higher than if they had 50,000 documents.
I would say that for the vast majority of Notes applications, using date computations will not make a noticeable different in performance.
Humbly submitted,
Dave Navarre
Chub Toad