yes but i just want to retrieve records from a certain View. Calendar for example.If i use the dbSearch, he will retrieve all the matching records not depending on the view.
Muller, your instincts are correct. It is generally more efficient to use FTSearch on a view, rather than search the entire database with a formula, assuming the database is full-text indexed.
The query string for FTSearch is not a macro formula, however. This method uses the same syntax as searches in the “search this view” field:
This query syntax is documented in the client help file, in a document entitled, “Refining a search query using operators”. In your case, you probably want to do something like:
Note: For your particular search, where you want documents modified since a certain date, the NotesDatabase.Search method is actually not a bad choice if the view contains most of the documents in the database or if the number of matching documents is likely to be small. That’s because the Search method has a second argument that lets you specify a date/time where you only want documents created or modified since that time, and this is pretty efficient because it uses an internal table of all notes sorted by when modified.