title: Incorrect results while using cts:element-range-query on last-modified property and how to bind external variables in XQuery
body: <p>I am creating an AdhocQuery as:<strong>session.newAdhocQuery("cts:search(fn:collection(),cts:properties-query(cts:element-range-query(xs:QName(\"prop:last-modified\"),\"&lt;\",current-dateTime() - xs:dayTimeDuration(\"P1D\"))))");</strong></p>
  
  <p>value of current-dateTime : 2014-05-15T20:27:34.468+05:30</p>
  
  <p>Still results are returned with last-modified date less than current date time.
  Below are some sample results:</p>
  
  <p>/content/1878818.doc 2014-05-12T19:59:16+05:30</p>
  
  <p>/content/1878965.doc 2014-05-12T19:59:16+05:30</p>
  
  <p>/content/1878105.doc 2014-05-12T19:55:48+05:30</p>
  
  <p>And 1 more thing instead of current-dateTime() how can I use some other dateTime in an XQuery.</p>
  
  <p>Thanks,</p>
  
  <p>Poonam</p>