This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal



Sep 7, 2011, 5:59 PM
35 Posts
topic has been resolvedResolved

Searching View for Date Range

  • Category: Other
  • Platform: Windows
  • Release: 8.5.2
  • Role: Developer
  • Tags:
  • Replies: 4
Hi,
I am trying to do a search for documents in a view based on the dates selected by the user.   
 
In the View-Data-Search in View Results-Computed Field I have the following:
 

var tmpArray = new Array("");

var cTerms = 0;

var sStartDate = getComponent("startDate").getValue();

if( sStartDate != null & sStartDate != "" ){

var sStartDateTime:NotesDateTime = session.createDateTime(sStartDate);

tmpArray[cTerms++] = "(FIELD dateShow = " + sStartDateTime.getDateOnly() + ")";

}

My dateShow field is Date/Time and I return documents for the date I select but I would like to create a date range and use => and <=  with an EndDate..Any clues?   
Sep 8, 2011, 7:00 AM
170 Posts
Re: Searching View for Date Range
You would need to do a db search for the documents but the problem is that that search would be quite slow
an when the number of documents increases in the database the search would be slower and slower. 
But It all depends on how many documents you are expecting. 
 
I would compute a text field with the date written in ISO format YYYY-MM-DD because that type of date can be sorted as text. 
And the search in the database is much faster because it's text. 
I normally don't suggest that you write dates as text but if you are going to do searches date fields are not optimal at all. 
 
Sep 8, 2011, 1:49 PM
35 Posts
Re: Searching View for Date Range
Thanks Fredrik.. If I have my dates as text I cannot use the > or < in my search to get a range of documents, correct?  I believe I will get the "Query is Not Understandable" error.
Sep 9, 2011, 3:02 PM
35 Posts
Re: Searching View for Date Range
Excellent suggestion...Search works great and fast! Thanks!

This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal