<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.appian.com/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>I am creating a query entity rule where I need to compare one of my ri value whi</title><link>https://community.appian.com/discussions/f/rules/7880/i-am-creating-a-query-entity-rule-where-i-need-to-compare-one-of-my-ri-value-whi</link><description>I am creating a query entity rule where I need to compare one of my ri value which is date type with the DB column which is datetime type. I am getting error, Cannot apply operator [EQUALS] to field [UpdatedDateTime] when comparing to value [TypedValue</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: I am creating a query entity rule where I need to compare one of my ri value whi</title><link>https://community.appian.com/thread/104446?ContentTypeID=1</link><pubDate>Fri, 18 Nov 2022 12:21:08 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:44b32eb6-88d6-4704-8041-571c9e88eb38</guid><dc:creator>shaikhm0001</dc:creator><description>&lt;p&gt;I think you should use this&amp;nbsp;{gmt(todate(ri!assignedOn)),gmt(todate(ri!assignedOn))+day()},&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I am creating a query entity rule where I need to compare one of my ri value whi</title><link>https://community.appian.com/thread/32609?ContentTypeID=1</link><pubDate>Tue, 21 Jun 2016 16:09:17 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:ae572e1f-6418-4fd1-b6cd-b0b6f935aa45</guid><dc:creator>sikhivahans</dc:creator><description>True, that&amp;#39;s expected, fortunately I didn&amp;#39;t find a need on my local machine :-).&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I am creating a query entity rule where I need to compare one of my ri value whi</title><link>https://community.appian.com/thread/32608?ContentTypeID=1</link><pubDate>Tue, 21 Jun 2016 16:04:17 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:04593f95-e7a9-4875-999e-b8fe39c6e970</guid><dc:creator>Ravi Roshan</dc:creator><description>Actually fn!datetime() was providing time based on PST.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I am creating a query entity rule where I need to compare one of my ri value whi</title><link>https://community.appian.com/thread/32607?ContentTypeID=1</link><pubDate>Tue, 21 Jun 2016 16:03:12 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:1bb953ff-df55-4a24-aaf2-5a6008919aa1</guid><dc:creator>Ravi Roshan</dc:creator><description>Yes, the reason to use fn!userdatetime() is that while using fn!datetime() I was getting mismatch in timing.&lt;br /&gt;The code I pasted above was providing 6/16/2016 4:59 PM PDT when I used fn!datetime() however after using fn!userdatetime() I got exact value i.e., 6/16/2016 11:59 PM PDT&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I am creating a query entity rule where I need to compare one of my ri value whi</title><link>https://community.appian.com/thread/32605?ContentTypeID=1</link><pubDate>Tue, 21 Jun 2016 15:51:23 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:2430b581-cc95-413c-a1db-e6e4b738aeec</guid><dc:creator>sikhivahans</dc:creator><description>@ravir Good, userdatetime() can also be used and is another variant of datetime() which returns the value in local timezone.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I am creating a query entity rule where I need to compare one of my ri value whi</title><link>https://community.appian.com/thread/32604?ContentTypeID=1</link><pubDate>Tue, 21 Jun 2016 15:43:46 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:02483220-7cf7-434a-9470-a2888ebdec07</guid><dc:creator>Ravi Roshan</dc:creator><description>Hi sikhivahans, I also tried below approach and it works.&lt;br /&gt;&lt;br /&gt;userdatetime(year(ri!updatedDate),month(ri!updatedDate),day(ri!updatedDate),hour(time(23,59,59)),minute(time(23,59,59)),second(time(23,59,59)))&lt;br /&gt;&lt;br /&gt;Thanks everyone!!!&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I am creating a query entity rule where I need to compare one of my ri value whi</title><link>https://community.appian.com/thread/32603?ContentTypeID=1</link><pubDate>Tue, 21 Jun 2016 15:40:03 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:af277592-2b88-4e24-bf45-f683a50ce4ff</guid><dc:creator>sikhivahans</dc:creator><description>Agree with @rajasekharp that there isn&amp;#39;t a need to use cast(),typeof() etc as suggested by a practitioner in his comments above, because casting consumes time as it needs to determine the data type of the dataset first and further cast the dataset to the desired data type and obviously this isn&amp;#39;t as straight forward as todatetime(). Casting might be extremely helpful here if we are depending on the field in the CDT (for instance, cast(typeof(local!mycdt.timestampField)),&amp;lt;myData&amp;gt;) and are not aware of the type of data before hand.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I am creating a query entity rule where I need to compare one of my ri value whi</title><link>https://community.appian.com/thread/32601?ContentTypeID=1</link><pubDate>Tue, 21 Jun 2016 15:31:56 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:cae6660f-edb5-4f2a-b051-cd4390b2b9a8</guid><dc:creator>sikhivahans</dc:creator><description>I might be wrong, but afaik, I don&amp;#39;t think that simply making use of todatetime() or cast() as suggested above will help you here because I can clearly see that you need to filter the data based on the date whereas the data consists of timestamps and these may not match against the filter value because I guess usage of conversion functions on a date will evaluate to the latest time based on the logged in user. &lt;br /&gt;&lt;br /&gt;There could be two solutions here as per my knowledge:&lt;br /&gt;&lt;br /&gt;1. Add one more column in your view which gets the date part from the existing timestamp column and use this to filter the data.&lt;br /&gt;2. Build a datetime range query filter on the corresponding timestamp column, for instance, you may do as follows and use the same as filter in the queryEntity(). This way you can get all the records associated with a particular date without much bothering about their timestamps.&lt;br /&gt;&lt;br /&gt;a!queryFilter(&lt;br /&gt;   field: &amp;quot;myTimeStampColumn&amp;quot;,&lt;br /&gt;   operator: &amp;quot;between&amp;quot;,&lt;br /&gt;   value: {datetime(year(ri!date),month(ri!date),day(ri!date),0,0,0),datetime(year(ri!date),month(ri!date),day(ri!date),23,59,59)}&lt;br /&gt;)&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I am creating a query entity rule where I need to compare one of my ri value whi</title><link>https://community.appian.com/thread/32600?ContentTypeID=1</link><pubDate>Tue, 21 Jun 2016 15:27:30 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:015f71ba-001a-4927-ba9b-c4713e75b89b</guid><dc:creator>Rajasekhar Pamidipati</dc:creator><description>I think the problem is with the ri. Up to my knowledge I think you are saving the datateime value into a text type variable in Appian and I suspect the value format is &amp;#39;yyyy-MM-dd&amp;#39; instead of &amp;#39;MM-dd-yyyy&amp;#39;. Please check the format once.&lt;br /&gt;&lt;br /&gt;In any case, you need to make sure the value format as &amp;#39;MM-dd-yyyy&amp;#39; and then convert the value to datetime by using either of the functions: todatetime(), cast().&lt;br /&gt;I would recommend you to go for todatetime() function because the execution time will be faster than cast()&lt;br /&gt;&lt;br /&gt;Hope it helps!!&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I am creating a query entity rule where I need to compare one of my ri value whi</title><link>https://community.appian.com/thread/32598?ContentTypeID=1</link><pubDate>Tue, 21 Jun 2016 15:16:46 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:249f85c8-8e19-4f2f-91f4-63118c4e6154</guid><dc:creator>sparshs</dc:creator><description>the value you are providing should be of date time format not date format.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I am creating a query entity rule where I need to compare one of my ri value whi</title><link>https://community.appian.com/thread/32594?ContentTypeID=1</link><pubDate>Tue, 21 Jun 2016 15:06:44 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:f6484b60-547e-430c-86b3-2b092ca44ca6</guid><dc:creator>Ravi Roshan</dc:creator><description>I have tried this, it seems not working. &lt;br /&gt;I have value like &lt;br /&gt;&lt;br /&gt;2016-06-16 11:26:44.310&lt;br /&gt;2016-06-16 11:27:23.850&lt;br /&gt;2016-06-16 11:35:50.540&lt;br /&gt;2016-06-16 12:13:51.710&lt;br /&gt;2016-06-16 12:20:28.170 in DB, and I am providing value just 2016-06-16.&lt;br /&gt;&lt;br /&gt;The approach you suggested it is giving blank record.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I am creating a query entity rule where I need to compare one of my ri value whi</title><link>https://community.appian.com/thread/32593?ContentTypeID=1</link><pubDate>Tue, 21 Jun 2016 15:01:43 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:ed686983-4627-4ce4-84c9-2acd647eb5da</guid><dc:creator>Sidhant Behura</dc:creator><description>You can also use cast to convert the date in the query entity rule to date time.&lt;br /&gt;Example: cast(typeof(now()),ri!dateVariable)&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I am creating a query entity rule where I need to compare one of my ri value whi</title><link>https://community.appian.com/thread/32592?ContentTypeID=1</link><pubDate>Tue, 21 Jun 2016 14:58:56 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:c35062d9-4117-40d7-95a5-7db5e60a2893</guid><dc:creator>sparshs</dc:creator><description>as suggested by rahulg262 you can convert ri to datetime.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I am creating a query entity rule where I need to compare one of my ri value whi</title><link>https://community.appian.com/thread/32590?ContentTypeID=1</link><pubDate>Tue, 21 Jun 2016 14:56:13 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:3bd7850c-f832-4ab7-87e0-f02086a4f8d0</guid><dc:creator>Rahul Gundu</dc:creator><description>We can convert the value into date time and compare the values.&lt;br /&gt;Example:&lt;br /&gt;&lt;br /&gt;fn!todatetime(ri!date) OR&lt;br /&gt;fn!datetime(fn!year(ri!date),fn!month(ri!date),fn!day(ri!date),-7,0,0,0)&lt;br /&gt;&lt;br /&gt;a!queryFilter(field: &amp;quot;startDateTime&amp;quot;,operator: &amp;quot;&amp;gt;&amp;quot;,value: fn!todatetime(ri!date))&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>