I am getting the error : "Relational operators are not supported in text fields" when I am doing db.FTSearch(FIELD examplefield >= 02/25/2013). Here field name is "examplefield" & field type is datetime
Can any one help for fixing this issue?
I am getting the error : "Relational operators are not supported in text fields" when I am doing db.FTSearch(FIELD examplefield >= 02/25/2013). Here field name is "examplefield" & field type is datetime
Can any one help for fixing this issue?
As described in the question that Simon linked to, the UNK table in a database will determine the data type that is used for a field when doing full text searches. The data type you have set for that field on any particular form does not matter - the field in the UNK table is defined by actual data on documents, and does not automatically re-calculate itself. So, you first want to ensure that "examplefield" in every document in which it exists has a datatype for date-time. But then, you would also need to re-build the UNK table. There are 2 ways - that I know of - to do this:
Also, you can check the datatype for a field in the UNK table using the freeware NotesPeek tool - which you can download from here: http://www-01.ibm.com/support/docview.wss?uid=swg24005686
In general, I wouldn't use FTSearch. I would create a hidden view with the first column sorted by examplefield as text with format yyyy-mm-dd. Then, you can use this:
set o_doc = o_hidden_view.GetDocumentByKey("2013-03-25")
while not o_doc is nothing
'Do something
set o_doc = o_view.GetnextDocument(o_doc)
Wend
In my opinion, it has a better time response at expense of put the load in the server. As always, it depends what type data you want to handle.