<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Using CurrentDate in NXQL in Nuxeo Forum</title>
    <link>https://connect.hyland.com/t5/nuxeo-forum/using-currentdate-in-nxql/m-p/326389#M13390</link>
    <description>&lt;P&gt;Hi, did you try:
"SELECT * FROM Document WHERE dc:created &amp;lt;= DATE '@{CurrentDate.format("yyyy-MM-dd HH:mm:ss")}'"&lt;/P&gt;
&lt;P&gt;Or you can have a look to &lt;A href="https://answers.nuxeo.com/general/q/23699bc926634b439b552c3848e12ad1/How-do-I-pass-a-date-relative-to-the-current-date-into-a-Query-Filter" target="test_blank"&gt;https://answers.nuxeo.com/general/q/23699bc926634b439b552c3848e12ad1/How-do-I-pass-a-date-relative-to-the-current-date-into-a-Query-Filter&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 09 Jun 2017 09:26:00 GMT</pubDate>
    <dc:creator>00000001_</dc:creator>
    <dc:date>2017-06-09T09:26:00Z</dc:date>
    <item>
      <title>Using CurrentDate in NXQL</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/using-currentdate-in-nxql/m-p/326388#M13389</link>
      <description>&lt;P&gt;Hi!&lt;/P&gt;
&lt;P&gt;In Nuxeo 6.0 HF 38 I'm trying to use CurrentDate in NXQL in avanced search or by quering &lt;A href="http://nuxeoserver/nuxeo/api/v1/query" target="test_blank"&gt;http://nuxeoserver/nuxeo/api/v1/query&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;When I try this, it works:
&lt;A href="http://nuxeoserver/nuxeo/api/v1/query?query=SELECT" target="test_blank"&gt;http://nuxeoserver/nuxeo/api/v1/query?query=SELECT&lt;/A&gt; * FROM Document WHERE dc:created &amp;gt; TIMESTAMP '2017-04-04 00:00:00'&lt;/P&gt;
&lt;P&gt;But this doesn't work :
&lt;A href="http://nuxeoserver/nuxeo/api/v1/query?query=SELECT" target="test_blank"&gt;http://nuxeoserver/nuxeo/api/v1/query?query=SELECT&lt;/A&gt; * FROM Document WHERE dc:created &amp;gt; TIMESTAMP '@{CurrentDate.days(-1).format("yyyy-MM-dd HH:mm:ss")}'&lt;/P&gt;
&lt;P&gt;I get this error :
{"entity-type":"exception","code":"org.nuxeo.ecm.webengine.WebException","status":400,"message":"Failed to execute query: java.lang.IllegalArgumentException: Invalid format: "@{CurrentDate.days(-1).format("y..." in query: SELECT * FROM Document WHERE dc:created &amp;gt; TIMESTAMP '@{CurrentDate.days(-1).format("yyyy-MM-dd HH:mm:ss")}'"}&lt;/P&gt;
&lt;P&gt;Thanks for help.&lt;/P&gt;</description>
      <pubDate>Fri, 05 May 2017 10:20:47 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/using-currentdate-in-nxql/m-p/326388#M13389</guid>
      <dc:creator>Thierry_SEBBAR</dc:creator>
      <dc:date>2017-05-05T10:20:47Z</dc:date>
    </item>
    <item>
      <title>Re: Using CurrentDate in NXQL</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/using-currentdate-in-nxql/m-p/326389#M13390</link>
      <description>&lt;P&gt;Hi, did you try:
"SELECT * FROM Document WHERE dc:created &amp;lt;= DATE '@{CurrentDate.format("yyyy-MM-dd HH:mm:ss")}'"&lt;/P&gt;
&lt;P&gt;Or you can have a look to &lt;A href="https://answers.nuxeo.com/general/q/23699bc926634b439b552c3848e12ad1/How-do-I-pass-a-date-relative-to-the-current-date-into-a-Query-Filter" target="test_blank"&gt;https://answers.nuxeo.com/general/q/23699bc926634b439b552c3848e12ad1/How-do-I-pass-a-date-relative-to-the-current-date-into-a-Query-Filter&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2017 09:26:00 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/using-currentdate-in-nxql/m-p/326389#M13390</guid>
      <dc:creator>00000001_</dc:creator>
      <dc:date>2017-06-09T09:26:00Z</dc:date>
    </item>
    <item>
      <title>Re: Using CurrentDate in NXQL</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/using-currentdate-in-nxql/m-p/326390#M13391</link>
      <description>&lt;P&gt;Hi Saimir,&lt;/P&gt;
&lt;P&gt;With this :
&lt;A href="http://nuxeoserver/nuxeo/api/v1/query?query=SELECT" target="test_blank"&gt;http://nuxeoserver/nuxeo/api/v1/query?query=SELECT&lt;/A&gt; * FROM Document WHERE dc:created &amp;lt;= DATE '@{CurrentDate.days(-1).format(“yyyy-MM-dd HH:mm:ss”)}'&lt;/P&gt;
&lt;P&gt;I got the same error :
{"entity-type":"exception","code":"org.nuxeo.ecm.webengine.WebException","status":400,"message":"Failed to execute query: java.lang.IllegalArgumentException: Invalid format: "@{CurrentDate.days(-1).format(“y..." in query: SELECT * FROM Document WHERE dc:created &amp;gt; DATE '@{CurrentDate.days(-1).format(“yyyy-MM-dd HH:mm:ss”)}'"}&lt;/P&gt;
&lt;P&gt;When I use this query (the same in my first question) in an automation chain it works :
SELECT * FROM Document WHERE dc:created &amp;gt; TIMESTAMP '@{CurrentDate.days(-1).format(“yyyy-MM-dd HH:mm:ss”)}'&lt;/P&gt;
&lt;P&gt;but it dosen't work in the API Url nor in NSQL Advanced search.&lt;/P&gt;
&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Mon, 12 Jun 2017 08:10:12 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/using-currentdate-in-nxql/m-p/326390#M13391</guid>
      <dc:creator>Thierry_SEBBAR</dc:creator>
      <dc:date>2017-06-12T08:10:12Z</dc:date>
    </item>
    <item>
      <title>Re: Using CurrentDate in NXQL</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/using-currentdate-in-nxql/m-p/326391#M13392</link>
      <description>&lt;P&gt;Hi, You can't access mvel  ( "@{CurrentDate.days(-1)")  function here because at this point it  is out of context. I suggest You  to  build some client code witch will call the rest service&lt;/P&gt;</description>
      <pubDate>Mon, 12 Jun 2017 08:54:45 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/using-currentdate-in-nxql/m-p/326391#M13392</guid>
      <dc:creator>00000001_</dc:creator>
      <dc:date>2017-06-12T08:54:45Z</dc:date>
    </item>
    <item>
      <title>Re: Using CurrentDate in NXQL</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/using-currentdate-in-nxql/m-p/326392#M13393</link>
      <description>&lt;P&gt;OK that's why. Thank you Saimir for your help.&lt;/P&gt;</description>
      <pubDate>Mon, 12 Jun 2017 09:04:02 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/using-currentdate-in-nxql/m-p/326392#M13393</guid>
      <dc:creator>Thierry_SEBBAR</dc:creator>
      <dc:date>2017-06-12T09:04:02Z</dc:date>
    </item>
    <item>
      <title>Re: Using CurrentDate in NXQL</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/using-currentdate-in-nxql/m-p/326393#M13394</link>
      <description>&lt;P&gt;you're welcome&lt;/P&gt;</description>
      <pubDate>Mon, 12 Jun 2017 09:08:04 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/using-currentdate-in-nxql/m-p/326393#M13394</guid>
      <dc:creator>00000001_</dc:creator>
      <dc:date>2017-06-12T09:08:04Z</dc:date>
    </item>
  </channel>
</rss>

