<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://www.aras.com/community/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>How do I set a where statement on a Query Definition against the current date the query is run?</title><link>https://www.aras.com/community/f/development/37056/how-do-i-set-a-where-statement-on-a-query-definition-against-the-current-date-the-query-is-run</link><description>I want to only have it pull a specific relationship (Part AML) if a custom date field &amp;quot;Valid To&amp;quot; is greater than the current date. I am able to create the Where that compares it against a specific date, but this query definition is pulled by another process</description><dc:language>ja-JP</dc:language><generator>Telligent Community 12</generator><item><title>RE: How do I set a where statement on a Query Definition against the current date the query is run?</title><link>https://www.aras.com/community/thread/9005?ContentTypeID=1</link><pubDate>Mon, 28 Nov 2022 19:10:58 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:4700c6c1-84bf-415b-ad30-8c683251bd04</guid><dc:creator>Ben Pecot</dc:creator><description>&lt;p&gt;I was not able to find a more elegant dynamic solution so instead I have a method that updates the filter on the query definition and added that method to the scheduler.&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How do I set a where statement on a Query Definition against the current date the query is run?</title><link>https://www.aras.com/community/thread/8423?ContentTypeID=1</link><pubDate>Mon, 20 Jun 2022 12:38:28 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:fa6301d0-a43f-4df9-8a7d-c123618974ed</guid><dc:creator>AngelaIp</dc:creator><description>&lt;p&gt;Hi Ben,&lt;/p&gt;
&lt;p&gt;thanks for sharing your test results!&lt;/p&gt;
&lt;p&gt;After checking the sample I am not sure if&amp;nbsp;&lt;span&gt;search_container.js is actually used by the QueryBuilder at all. If you set a debugger breakpoint, will it be triggered by the Query?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;In worst case we have to&amp;nbsp;&lt;/span&gt;customize some file in this folder:&amp;nbsp;&amp;nbsp;...\Client\Modules\aras.innovator.QueryBuilder&lt;/p&gt;
&lt;p&gt;If you have a subscription maybe ask Aras for this feature. It would definitely be a useful enhancement!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How do I set a where statement on a Query Definition against the current date the query is run?</title><link>https://www.aras.com/community/thread/8407?ContentTypeID=1</link><pubDate>Wed, 15 Jun 2022 22:08:31 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:b9a5f285-fbbc-423d-a524-a0c09d872e80</guid><dc:creator>Ben Pecot</dc:creator><description>&lt;p&gt;I used AML to inject&amp;nbsp; the following code onto the qry_QueryItem:&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;lt;![CDATA[&amp;lt;condition&amp;gt;&lt;/span&gt;&lt;br /&gt; &lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;lt;gt&amp;gt;&lt;/span&gt;&lt;br /&gt; &lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;property name="cub_valid_to" /&amp;gt;&lt;/span&gt;&lt;br /&gt; &lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;@now&lt;/span&gt;&lt;br /&gt; &lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;lt;/gt&amp;gt;&lt;/span&gt;&lt;br /&gt; &lt;span&gt;&amp;lt;/condition&amp;gt;]]&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;It says that text is not accepted and the only valid options are property, constant, count, max, min, any, and all.&amp;nbsp; None of those tags work with the dynamic dates that were provided in that fix.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How do I set a where statement on a Query Definition against the current date the query is run?</title><link>https://www.aras.com/community/thread/8406?ContentTypeID=1</link><pubDate>Wed, 15 Jun 2022 22:01:33 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:22da3119-de33-4084-b36d-8830b2ba1e10</guid><dc:creator>Ben Pecot</dc:creator><description>&lt;p&gt;I have had a chance to test this.&amp;nbsp; It does not appear to work. &amp;quot;&lt;span&gt;String was not recognized as a valid DateTime.&amp;quot;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;It does not recognize @now as a valid value in the Where Condition Builder so I had to save it like: [Valid To] &amp;gt; &amp;#39;@now&amp;#39;&lt;/p&gt;
&lt;p&gt;That translates to this on the qry_QueryItem:&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;lt;![CDATA[&amp;lt;condition&amp;gt;&lt;/span&gt;&lt;br /&gt; &lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;lt;gt&amp;gt;&lt;/span&gt;&lt;br /&gt; &lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;property name="cub_valid_to" /&amp;gt;&lt;/span&gt;&lt;br /&gt; &lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;constant&amp;gt;@now&amp;lt;/constant&amp;gt;&lt;/span&gt;&lt;br /&gt; &lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;lt;/gt&amp;gt;&lt;/span&gt;&lt;br /&gt; &lt;span&gt;&amp;lt;/condition&amp;gt;]]&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I did a test with a valid date in the format of&amp;nbsp;[Valid To] &amp;gt; &amp;#39; 2022-06-15T14:57:17&amp;#39; and it worked correctly and saves it on the qry_QueryItem the same way with the date as the constant, but it requires the date to be static.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How do I set a where statement on a Query Definition against the current date the query is run?</title><link>https://www.aras.com/community/thread/7787?ContentTypeID=1</link><pubDate>Tue, 30 Nov 2021 09:46:31 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:f8db66b9-13d8-4d2b-905b-74383c7eec3e</guid><dc:creator>AngelaIp</dc:creator><description>&lt;p&gt;Hi Ben,&lt;/p&gt;
&lt;p&gt;I haven&amp;acute;t needed this use case yet, but it sounds definitely useful. By default Innovator dcannot search for relative dates like &amp;quot;now&amp;quot; or &amp;quot;yesterday&amp;quot;.&lt;/p&gt;
&lt;p&gt;But this project provided a patch to add this search option with help of parameters you can use inside your search:&lt;/p&gt;
&lt;p&gt;&lt;a href="/i/projects/advanced-search-options---relative-date-searches"&gt;https://community.aras.com/i/projects/advanced-search-options---relative-date-searches&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I see a high change it can work in a Query Definition, cause basically Query Definition just build an AML query.&lt;/p&gt;
&lt;p&gt;Would be happy to hear your test results!!&lt;/p&gt;
&lt;p&gt;Angela&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>