<?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>Query to add an integer (day) to a date</title><link>https://community.appian.com/discussions/f/data/29303/query-to-add-an-integer-day-to-a-date</link><description>Hi! I&amp;#180;m trying to query a database which has: 
 - A date field (month-day-year) 
 - A number of days to add (integer) 
 I want to use a query in order to add the number of days (integer, I want it to be days) to the date field, and return a date field</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Query to add an integer (day) to a date</title><link>https://community.appian.com/thread/116067?ContentTypeID=1</link><pubDate>Wed, 12 Jul 2023 09:23:01 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:6e4d47d9-ab79-465d-92af-d1926516af32</guid><dc:creator>carlosp5114</dc:creator><description>&lt;p&gt;In the end I just made a sum of the process variables in the e-mail form, that was enough for me. Also, in the database I could do the same with a new custom record. Thanks!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Query to add an integer (day) to a date</title><link>https://community.appian.com/thread/116052?ContentTypeID=1</link><pubDate>Wed, 12 Jul 2023 04:53:52 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:6a4e032c-16ba-48f2-a343-ae0192d2e3ee</guid><dc:creator>Harshitha Mangamuri</dc:creator><description>&lt;p&gt;You can fetch the date and the no of days to be&amp;nbsp; added from the database to expression rule using the query entity and follow the below code for the desired Output. If you want to add multiple data you can use forEach().&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!localVariables(
/* Fetch the date and no of days to be added using query entity*/
  local!date:today(),
  local!noOfDays:2,
  local!result:local!date+local!noOfDays,
  local!result
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Query to add an integer (day) to a date</title><link>https://community.appian.com/thread/116049?ContentTypeID=1</link><pubDate>Wed, 12 Jul 2023 00:42:00 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:4fba2673-913e-484b-ac91-8daa03b8a7d8</guid><dc:creator>Mathieu Drouin</dc:creator><description>&lt;p&gt;Agree with Mike - get the data but do the add operation within Appian.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Query to add an integer (day) to a date</title><link>https://community.appian.com/thread/116036?ContentTypeID=1</link><pubDate>Tue, 11 Jul 2023 18:28:59 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:ff09c469-c385-4a9f-9724-87a719d23d96</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;This would be far easier to do just by writing an expression using Query Entity to fetch the date from the row in question and then add the number of days to it.&amp;nbsp; In general I strongly recommend against using the Query DB nodes like this unless there&amp;#39;s absolutely no other option.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>