cancel
Showing results for 
Search instead for 
Did you mean: 

DocumentQuery - Search on a single date without using the AddDateRange method

Kevin_Buse
Champ on-the-rise
Champ on-the-rise

While using the DocumentQuery class, is it possible to search against the system keyword "Document Date" without using the AddDateRange method? When you use the AddDateRange method, the code is translated into sql and it uses the "between" sql function in the query. When using the "between" sql function in oracle, you see a huge performance degradation when the dates used are the same day. For Ex. (select * from exTable where date between "01/01/2018" and "01/01/2018" ) performs slower than saying select * from exTable where date = "01/01/2018"

Is it possible to use the "AddKeyword" method on the DocumentQuery class to search against the system keyword "Document Date"? If it is possible, I could use the addkeyword method to target a single day and I would hope it would translate the code back into a sql statement that would use the equals operation.

1 ACCEPTED ANSWER

Daniel_Quill
Elite Collaborator
Elite Collaborator

There are few options to consider... You may look into using a custom query which will have the 'Document Date' as a column. Adding the 'Document Date' to a AddDisplayColumn(DisplayColumnType) may also be a solution. In order to retrieve this columns you will need to use the ExecuteQueryResults() off of the document query instead of using the usual Execute().

https://sdk.onbase.com/unitySDK/html/c28b8b5d-1e8a-fec5-2e74-e09f8da95568.htm

https://sdk.onbase.com/unitySDK/html/3f8251a7-e0b9-f129-4947-5319ba6a40c9.htm


View answer in original post

1 REPLY 1

Daniel_Quill
Elite Collaborator
Elite Collaborator

There are few options to consider... You may look into using a custom query which will have the 'Document Date' as a column. Adding the 'Document Date' to a AddDisplayColumn(DisplayColumnType) may also be a solution. In order to retrieve this columns you will need to use the ExecuteQueryResults() off of the document query instead of using the usual Execute().

https://sdk.onbase.com/unitySDK/html/c28b8b5d-1e8a-fec5-2e74-e09f8da95568.htm

https://sdk.onbase.com/unitySDK/html/3f8251a7-e0b9-f129-4947-5319ba6a40c9.htm