cancel
Showing results for 
Search instead for 
Did you mean: 

Query openCmis range of dates

jevr
Champ in-the-making
Champ in-the-making
Hi, i try to query for a custom property type date in alfresco with openCmis, the query works fine, but need to search by a range of dates, i see that the "between"not work in opencmist, how i can search with ranges?

I have a query like that, and this work fine.

"SELECT D.*,alias.customprefix:documentDate FROM cmis:document AS D JOIN customprefix:customAspect AS alias ON D.cmis:objectId = alias.cmis:objectId WHERE alias.customprefix:documentDate = TIMESTAMP '2013-04-22T12:52:12.123Z'"


Thanks!
2 REPLIES 2

jpotts
World-Class Innovator
World-Class Innovator
This example was taken from the <a href="https://github.com/jpotts/alfresco-developer-series/blob/master/content/content-tutorial-cmis/src/ma...">source code</a> that accompanies the custom content types tutorial:


System.out.println("Find content of type sc:whitepaper published between 1/1/2006 and 6/1/2007");   
queryString = "select d.cmis:objectId, w.sc:published from sc:whitepaper as d join sc:webable as w on d.cmis:objectId = w.cmis:objectId " +
"where w.sc:published > TIMESTAMP '2006-01-01T00:00:00.000-05:00' " +
                             " and w.sc:published < TIMESTAMP '2007-06-02T00:00:00.000-05:00'";
dumpQueryResults(getQueryResults(queryString));


Jeff

jevr
Champ in-the-making
Champ in-the-making
Solved.


Thanks for your help Jeff.