Tuesday, March 25, 2008

select in views with date

Very often we need to use Dates in view's SELECT. Let's say that we should show documents which are older than current day. What do we usually do?

SELECT FldName = @Now
SELECT FldName = @TextToTime("Today")


I just want to refresh head and show another approach. We can use schedule agent on server and modify SELECT formula each day.

Dim s As New NotesSession
Dim db As NotesDatabase
Dim view As NotesView
Dim dt As String

Set db = s.CurrentDatabase
dt = Join(Evaluate({@Text(@Today)}))
Set view = db.GetView("viewName")
view.SelectionFormula = {SELECT Form = "Form" & FldDate = (([} + dt + {]}


after that it will work faster and better. it's just only one another approach not more, but I like it )

2 comments :

Anonymous said...

what about replications ?

Dmytro said...

it has to work