Is it correct to select based on date in a Lotus Notes View?

394 Views Asked by At

I have some documents that contain flight information(eg a flight from Paris to London today 22-05-2015).

I want to have 2 views: 1 for today and future flights and 1 for the past flights.

I could do these selections:

SELECT Form="flight" & fdate >= @Date(@Today)
SELECT Form="flight" & fdate < @Date(@Today)

Is it correct in terms of system performance? I see in domino designer that the view is refreshing every second. What is the best practise for this kind of selection?

1

There are 1 best solutions below

0
On BEST ANSWER

Performance- wise it is a very bad idea to put @Today or @Now in a view selection formula.

There are some alternatives to do what you want to do:

  1. Use @TextToTime( "Today" ) or similar.

In that case, the view indexer does not "know" that something changed. You need to update view index manually once every day using an updall command (program document:

load updall yourdatabase.nsf -T "YourTodayView"
  1. Use code in an agent to update the documents, so that they have a flag "I am today"

Disadvantage: Nightly document changes after the agent run

  1. Use a folder and use a nightly agent to put documents in the right folder

Disadvantage: You have to take care for "newly created" documents in a special way.

Examples are taken from this IBM link. There is also a blog- entry dealing with this, and searching for lotus notes view selection @today in google will give you a lot more results with examples and code.