Subject: Adjust date
Need help to adjust “January 1, 2011” in the>below search formula. below formula is
selecting 3 months older email from mailbox.
need to select before “January 1, 2011” all
emails.
It looks to me like you are building a search string to use from within Lotusscript in db.Search(). For performance reasons, you should use db.FTSearch() instead.
You really should explain more what you are trying to do, and the context of your request…
Please read this link:
http://www-10.lotus.com/ldd/nd6forum.nsf/0/410171d83ddba6d485256df100832aba
There is no “January 1, 2011” in your code, but if you want to use that exact date, you could just hard code that.
I would have done it like below, based on some assumptions, like that you want to display all documents older than todays date instead of all older than today minus 3 months… Not that that really make any sense, as you probably have very little email sent from the future… 
So let’s make the code more flexible, you can set the date you want to use as cut-off date for mail, only returning mail older than that date.
Dim searchFormula As String
Dim nowDate As NotesDateTime
Dim cutoffDate As String
cutoffDate = “01/01/2011”
Set nowDate = New NotesDateTime(cutoffDate)
searchFormula = {Form=“Memo”:“Reply” & }
searchFormula = searchFormula + {(DeliveredDate<} + nowDate.DateOnly + { | }
searchFormula = searchFormula + {PostedDate<} + nowDate.DateOnly + {)}
Then you can call db.Search(searchFormula).
Const SEARCHFORMULA = “Form = ““Memo”” : ““Reply”” : “””" & ( ( @IsAvailable(delivereddate) & ((@year(@Today) * 12 + @Month(@Today)) - (@year(DeliveredDate) * 12 + @Month(DeliveredDate)) > 3) ) | ( @IsAvailable(PostedDate) & !@IsAvailable(DeliveredDate) & ((@year(@Today) * 12 + @Month(@Today)) - (@year(PostedDate) * 12 + @Month(PostedDate)) > 3) )) "