[MarkLogic Dev General] cts:element-range-query

Kapoor, Pragya PKapoor1 at innodata.com
Thu Jan 21 01:21:44 PST 2016


I need to query an element(Date) using cts:element-range-query, but the value this element(Date) is in different format.

<Date Year="2011" Month="03" Day="04">

2011 Mar 04

query :

  let $fromDate := xs:date("2011-04-08")
  let $toDate := xs:date("2011-06-08")
  let $docs := cts:search(fn:doc("/misc/DocList.xml")/DocumentList/Document,
                        cts:element-range-query(xs:QName("Date"), "<=",$fromDate),
                         cts:element-range-query(xs:QName("Date"), ">=",$toDate)
 return $docs

How can run this query or I need to use some other api?



"This e-mail and any attachments transmitted with it are for the sole use of the intended recipient(s) and may contain confidential , proprietary or privileged information. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message. Any unauthorized review, use, disclosure, dissemination, forwarding, printing or copying of this e-mail or any action taken in reliance on this e-mail is strictly prohibited and may be unlawful."
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://developer.marklogic.com/pipermail/general/attachments/20160121/56706eb4/attachment-0001.html 

More information about the General mailing list