Unfortunately extracting the year of a date field is not supported by XWQL. See http://jira.xwiki.org/browse/XWIKI-6645. On Wed, Sep 23, 2015 at 12:01 PM, Sylvain MARIE <[email protected]> wrote:
Hello,
The following query counts documents by publication date. {{velocity}} ## Count all publication dates #set($results=$services.query.xwql("select guide.DocumentDate, count(guide.DocumentDate) from Document doc, doc.object(BIMGuides.GuideClass) as guide group by guide.DocumentDate order by guide.DocumentDate").execute()) PublicationDate,Count #foreach($result in $results) #set($resDate = $result.get(0)) #set($resString = $resDate.toString().substring(0, 10)) $resString,$result.get(1) #end {{/velocity}}
I would like to regroup publication dates by year (getting « 2014,3 » when 2 documents are published in Jan2014 and 1 in Oct2014) instead of getting all single dates.
Any idea ?
Thank you in advance! Sylvain
_______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
-- Thomas Mortagne