Hello, My question is how to write a formula in the view select to filter the documents which contains a checkedDate is in last two month.
for example, @Now=Feb 21,2008, we want to have all document which the @month(checkDate) is between Dec 21,2008 to feb 21,2008.
we used a formula :& ((@Now) - DateConsulted) < 5184000
but the thing is if @Now=March 1,2008, the collect documents includes Dec, 2007 as there are 29 days in Feb 2008. We only wnat to have the documents in March, Feb and Jan, no Dec,2007.
So, we can not to use days (518400) (60days) as formula.
@Now should not be used in view selection formulas due to the impact it has on performance due to view indexing.
There are several ways to do this such as using @Texttotime or running a daily agent that either sets a flag on the documents that should appear in the view or updates the view selection formula with a hard coded date.
Search the forum for something like View Selection @Now and you will find several discussions with the pros and cons of each method.
U can schedule the agent to run daily at a particular time… It can be done from agent properties (which opens wen u open an agent or by right clickin in an agent and selecting agent properties - Think u already know it, jus incase u dont.)
There at the bottom in Runtime select “On Schedule” and then click on schedule to select time and then select daily…
You should run this agent on all your desired documents, if the document matches your criteria it sets the “showInView” field value to “1” otherwise to “0”
The selection formula for the view should be: SELECT showInView = “1”