Hi,I need to select documents whereby they fall in a specific date range.
For example, the form I am using has a submit date.
I want to see all the documents between a user entered date variable…
So far, I can do this for example by year, using prompts and @SetViewInfo.
I can now also prompt for the date, but it doesn’t work, presumably because I don’t know how to convert it to a range of dates, or because the @SetViewInfo is only looking for a specific value…
I don’t particulary have to use @setviewinfo, and am happy to use LS if there is possibilities there. I don’t want the user to do anything other than just click on the view and enter some dates however…
Subject: Select documents within a given date range
I don’t think the @SetViewInfo will work because you can’t come up with a single category to filter by using a date range.
My thought was to use LS to do a search with your date range then loop through the result set and drop those documents into a folder.
Depending on the volume of documents, you could use a view that is sorted by date and just walk the view, making sure the date is between the dates provided by the user.
Subject: RE: Select documents within a given date range
Do you know where to put the code, for example, in the PostOpen of an already existing view? Or an agent which uses this code to create a view or somewhere else???
Subject: RE: Select documents within a given date range
Views Part 1 Views Part 2
If not a subscriber, you can still download the sample database. Part 2 shows how to display results of an arbitrary search, including based on a range of dates.
Subject: RE: Select documents within a given date range
OK, I’ve downloaded the database. It doesn’t help really. I need to select a range of dates. As in my original post.
I had found this article before, but a) I can’t access it ($399 is a lot of money!), and b) The sample database does not have a range of dates selection anywhere…
What I’m really after is having a view, whereby, the user can enter a range of dates, and then the view displays documents whose field SubmitDate is between the dates they select…
Any examples/code samplers on how to do this would be great…
Otherwise, I’ll have to give up, and hard code the dates into the view - this is annoying, because it means every year I will have the same problem…
Subject: RE: Select documents within a given date range
This is one of those things that’s easier to do on the web than in the Notes client.
on the web, you’d use &Starkey= and &untilkey
In the client, I think you have to use a private on first use or desktop private on first use view. Embed it in a form, and use the NotesView.SelectionFormula property to get the right documents. Then refresh the view, and then the workspace.