<?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>adding a day to a date</title><link>https://community.appian.com/discussions/f/rules/8336/adding-a-day-to-a-date</link><description>What is the way to add a day to a date? For example, when I do: datetime(year(today()), month(today()), day(today()) + 1, 13), it doesn&amp;#39;t work for the case when today() = last day of the month. For example, yesterday was the last day of the month (the</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: adding a day to a date</title><link>https://community.appian.com/thread/83217?ContentTypeID=1</link><pubDate>Thu, 01 Jul 2021 09:57:04 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:6034ede8-5829-44fb-92f8-9d985ecfecee</guid><dc:creator>Vincenzo Reggina</dc:creator><description>&lt;p&gt;Simply works,&amp;nbsp;still today.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: adding a day to a date</title><link>https://community.appian.com/thread/64244?ContentTypeID=1</link><pubDate>Fri, 25 Jan 2019 12:38:36 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:9eabe2a2-b06a-4e45-ba4e-11fd67872bce</guid><dc:creator>sauravk</dc:creator><description>Its working fine now. I have refreshed Data management. There were some sync issue with tables.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: adding a day to a date</title><link>https://community.appian.com/thread/64241?ContentTypeID=1</link><pubDate>Fri, 25 Jan 2019 11:52:00 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:e06a4e6d-ad0c-4a3c-b5b9-c5e18fb96a50</guid><dc:creator>ManuelHTG</dc:creator><description>remove the filtering, save the expression rule and call it from a different expression rule.&lt;br /&gt;
Test the rule and check the output as an expression. There you should be able to see which function is Appian calling to convert your data (ie fv!datetime).&lt;br /&gt;
&lt;br /&gt;
Once you see the function that is using, try to use the same one in your operator.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: adding a day to a date</title><link>https://community.appian.com/thread/64240?ContentTypeID=1</link><pubDate>Fri, 25 Jan 2019 11:28:10 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:06ad745c-d0c0-4f0a-9446-3521d1d8c03a</guid><dc:creator>sauravk</dc:creator><description>&lt;p&gt;I have checked this. Its coming out without filtering even coming out with todatestamp(today()) also. I have saved this in DB as timestamp only. Its not working with (&amp;gt;,today()+1,etc) where ever i am trying to fetch data greater then current date.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;=a!queryEntity(&lt;br /&gt; entity: cons!TEST,&lt;br /&gt; query: a!query(&lt;br /&gt; logicalExpression: a!queryLogicalExpression(&lt;br /&gt; operator: &amp;quot;AND&amp;quot;,&lt;br /&gt; filters: {&lt;br /&gt; if(&lt;br /&gt; ri!dateFlag = &amp;quot;date&amp;quot;,&lt;br /&gt; a!queryFilter(&lt;br /&gt; field: &amp;quot;start&amp;quot;,&lt;br /&gt; operator: &amp;quot;=&amp;quot;,&lt;br /&gt; value: todatetime(&lt;br /&gt; today()&lt;br /&gt; )&lt;br /&gt; ),&lt;br /&gt; a!queryFilter(&lt;br /&gt; field: &amp;quot;start&amp;quot;,&lt;br /&gt; operator: &amp;quot;&amp;gt;&amp;quot;,&lt;br /&gt; value: todatetime(today()+5*day())&lt;br /&gt; )&lt;br /&gt; )&lt;br /&gt; }&lt;br /&gt; ),&lt;br /&gt; pagingInfo: a!pagingInfo(&lt;br /&gt; startIndex: 1,&lt;br /&gt; batchSize: - 1&lt;br /&gt; )&lt;br /&gt; )&lt;br /&gt;).data&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: adding a day to a date</title><link>https://community.appian.com/thread/64239?ContentTypeID=1</link><pubDate>Fri, 25 Jan 2019 11:25:54 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:9580e263-f8ed-4a0a-868d-9c6c9752c73c</guid><dc:creator>ManuelHTG</dc:creator><description>it is difficult to say what is wrong without knowing how you have set-up the CDT, how you have saved the data on the DB and which data is present there.&lt;br /&gt;
&lt;br /&gt;
I would first get the data &amp;quot;start&amp;quot; from the DB without filtering. Then create an expression rule to play with the data and make sure you are handling well the date fields.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: adding a day to a date</title><link>https://community.appian.com/thread/64238?ContentTypeID=1</link><pubDate>Fri, 25 Jan 2019 11:12:16 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:5f1ac085-1c9d-4663-b828-5440e26b1ee3</guid><dc:creator>sauravk</dc:creator><description>&lt;p&gt;But my rule is not working . Can you suggest here why its filtering data for upcoming days. I have correct data in DB . For today() its working fine but whenever i try to fetch today()+1 or the way you suggested both are not working.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;=a!queryEntity(&lt;br /&gt; entity: cons!TEST,&lt;br /&gt; query: a!query(&lt;br /&gt; logicalExpression: a!queryLogicalExpression(&lt;br /&gt; operator: &amp;quot;AND&amp;quot;,&lt;br /&gt; filters: {&lt;br /&gt; if(&lt;br /&gt; ri!dateFlag = &amp;quot;date&amp;quot;,&lt;br /&gt; a!queryFilter(&lt;br /&gt; field: &amp;quot;start&amp;quot;,&lt;br /&gt; operator: &amp;quot;=&amp;quot;,&lt;br /&gt; value: todatetime(&lt;br /&gt; today()&lt;br /&gt; )&lt;br /&gt; ),&lt;br /&gt; a!queryFilter(&lt;br /&gt; field: &amp;quot;start&amp;quot;,&lt;br /&gt; operator: &amp;quot;&amp;gt;&amp;quot;,&lt;br /&gt; value: todatetime(today()+5*day())&lt;br /&gt; )&lt;br /&gt; )&lt;br /&gt; }&lt;br /&gt; ),&lt;br /&gt; pagingInfo: a!pagingInfo(&lt;br /&gt; startIndex: 1,&lt;br /&gt; batchSize: - 1&lt;br /&gt; )&lt;br /&gt; )&lt;br /&gt;).data&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: adding a day to a date</title><link>https://community.appian.com/thread/64237?ContentTypeID=1</link><pubDate>Fri, 25 Jan 2019 10:47:22 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:184308cf-e6c3-41b9-9d28-9f91b67dd9c2</guid><dc:creator>ManuelHTG</dc:creator><description>&lt;p&gt;if you want to do a date + day you should use the day() funtion&lt;/p&gt;
&lt;p&gt;i.e. now() + 7*day() will give you today + 7 days.&lt;/p&gt;
&lt;p&gt;Try with this:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://docs.appian.com/suite/help/18.4/fnc_date_and_time_day.html"&gt;https://docs.appian.com/suite/help/18.4/fnc_date_and_time_day.html&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;&lt;a href="/cfs-file/__key/communityserver-discussions-components-files/15/pastedimage1548416833720v1.png"&gt;&lt;img src="/resized-image/__size/320x240/__key/communityserver-discussions-components-files/15/pastedimage1548416833720v1.png" alt=" " /&gt;&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: adding a day to a date</title><link>https://community.appian.com/thread/64228?ContentTypeID=1</link><pubDate>Fri, 25 Jan 2019 07:04:40 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:b6b964c0-37f3-4815-89c5-bbe787dc2dde</guid><dc:creator>sauravk</dc:creator><description>its not working in my case  todatetime(today() + 3).&lt;br /&gt;
what is alternate of that&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: adding a day to a date</title><link>https://community.appian.com/thread/36549?ContentTypeID=1</link><pubDate>Mon, 05 Sep 2016 08:50:03 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:a7d2c430-9e84-46b3-b5de-a155e485ff4e</guid><dc:creator>gaurava322</dc:creator><description>Hi Eric, I think you can also use the calendar: &lt;a href="https://forum.appian.com/suite/help/16.2/System_Calendar_Settings.html"&gt;forum.appian.com/.../System_Calendar_Settings.html&lt;/a&gt;&lt;br /&gt;This way you would be able to achieve much more functionalities.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: adding a day to a date</title><link>https://community.appian.com/thread/36497?ContentTypeID=1</link><pubDate>Fri, 02 Sep 2016 08:55:01 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:29efabba-918e-4f72-bfff-c56faf55fa16</guid><dc:creator>Sally Mason</dc:creator><description>also wanted to add, remember gmt offset! this also works: gmt(date(2016, 08, 31)+1)&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: adding a day to a date</title><link>https://community.appian.com/thread/36482?ContentTypeID=1</link><pubDate>Thu, 01 Sep 2016 19:19:30 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:1ecbf592-f745-4508-8817-2e4afe0cde3c</guid><dc:creator>erickp</dc:creator><description>thanks guys!&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: adding a day to a date</title><link>https://community.appian.com/thread/36481?ContentTypeID=1</link><pubDate>Thu, 01 Sep 2016 19:18:24 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:28feadfe-b4d7-40fd-bdef-2b40bd93f597</guid><dc:creator>Ram</dc:creator><description>Hi erickp,&lt;br /&gt;&lt;br /&gt;Rather than adding 1 to &amp;quot;day&amp;quot; inside datetime() function, add 1 directly to the datetime() function directly as shown below. This might solve your problem.&lt;br /&gt;&lt;br /&gt;datetime(year(todate(&amp;quot;8/31/2016&amp;quot;)), month(todate(&amp;quot;8/31/2016&amp;quot;)), day(todate(&amp;quot;8/31/2016&amp;quot;)), 13)+1&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: adding a day to a date</title><link>https://community.appian.com/thread/36479?ContentTypeID=1</link><pubDate>Thu, 01 Sep 2016 17:45:47 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:1319713e-8ab3-495b-a033-f567a660501a</guid><dc:creator>sikhivahans</dc:creator><description>@erickp fn!eomonth() is one of the ways to determine if the date you are working on with is the last day in that particular month or not. For instance, to derive the current month's last day, use fn!eomonth(fn!today(),0) and similarly you can know the last day of a month of a given date.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: adding a day to a date</title><link>https://community.appian.com/thread/36478?ContentTypeID=1</link><pubDate>Thu, 01 Sep 2016 17:40:08 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:2aa996cf-c9d2-4a78-a4c7-cd4f189a587f</guid><dc:creator>baghavathit</dc:creator><description>For finding the next day, you can  use todate() function. like: todate(&amp;quot;some date&amp;quot;)+1. Eg: todate(&amp;quot;8/31/2016&amp;quot;)+1 will obviously return Sept 1, not august 32.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: adding a day to a date</title><link>https://community.appian.com/thread/36476?ContentTypeID=1</link><pubDate>Thu, 01 Sep 2016 17:32:41 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:d2bf2802-f74a-4993-9678-6b74b3690957</guid><dc:creator>Colton Beck</dc:creator><description>You can execute the following to test that the month rollover works as well:&lt;br /&gt;date(2016,8,31) + 1&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: adding a day to a date</title><link>https://community.appian.com/thread/36475?ContentTypeID=1</link><pubDate>Thu, 01 Sep 2016 17:30:08 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:deebe647-d8e8-433b-ba4b-f7f2444e95c8</guid><dc:creator>Colton Beck</dc:creator><description>Have you tried today()+1?&lt;br /&gt;&lt;br /&gt;This should handle the case you describe.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>