<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://www.infopathdev.com:443/utility/FeedStylesheets/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>General</title><link>https://www.infopathdev.com:443/forums/41.aspx</link><description>If you're not sure where to ask your question, ask it here. If necessary, our moderators will make sure it gets classified in the correct board.</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: Adding a date field and a number field to calculate a new date?</title><link>https://www.infopathdev.com:443/forums/thread/115947.aspx</link><pubDate>Thu, 30 Mar 2017 15:09:12 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:115947</guid><dc:creator>ChristinaGateley</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/115947.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=115947</wfw:commentRss><description>&lt;p&gt;I hadn&amp;#39;t thought about it, but you could be right!&lt;/p&gt;&lt;p&gt;I tried the alternative and&amp;nbsp;that worked great also.&lt;/p&gt;&lt;p&gt;Thank you very much for your&amp;nbsp;help and time :)&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Adding a date field and a number field to calculate a new date?</title><link>https://www.infopathdev.com:443/forums/thread/115933.aspx</link><pubDate>Wed, 29 Mar 2017 14:34:26 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:115933</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/115933.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=115933</wfw:commentRss><description>Do you suppose leap year is coming into play here at all? If you really just want to add years, let me know - you could do that with a substring formula, because incrementing the year is simple. XML dates are stored in yyyy-MM-dd format, so you can use substring-before to get just the year and increment it.... something like: concat(substring-before(fieldWithDate, &amp;quot;-&amp;quot;) + fieldWithNumberOfYears, &amp;quot;-&amp;quot;, substring-after(fieldWithDate, &amp;quot;-&amp;quot;))</description></item><item><title>Re: Adding a date field and a number field to calculate a new date?</title><link>https://www.infopathdev.com:443/forums/thread/115931.aspx</link><pubDate>Wed, 29 Mar 2017 10:59:51 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:115931</guid><dc:creator>ChristinaGateley</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/115931.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=115931</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;P.S. this doesn&amp;#39;t happen for every entry so could this be&amp;nbsp;dependent on the time that the document was created/published?&lt;/p&gt;&lt;p&gt;Thank you.&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Adding a date field and a number field to calculate a new date?</title><link>https://www.infopathdev.com:443/forums/thread/115930.aspx</link><pubDate>Wed, 29 Mar 2017 09:26:43 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:115930</guid><dc:creator>ChristinaGateley</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/115930.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=115930</wfw:commentRss><description>Hi Hilary,
The formula worked great; thank you.
My only issue now is that whilst the month and year is calculated correctly, the day is not. It appears to subtract day. For instance, I have a document with a 5 year review period from today, so I&amp;#39;d expect the review by date to be 29/03/22, but it returns as 28/03/22.  Do you perhaps know why it does this and what I can do to solve it?
Best wishes,
Christina.</description></item><item><title>Re: Adding a date field and a number field to calculate a new date?</title><link>https://www.infopathdev.com:443/forums/thread/115926.aspx</link><pubDate>Tue, 28 Mar 2017 14:43:12 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:115926</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/115926.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=115926</wfw:commentRss><description>You&amp;#39;ll need to use the addDays() function in InfoPath. So in your formula editor, click the button for inserting a function, and find the addDays() function. The first parameter is your date field and the second is the number you want to add. So maybe xdDate:AddDays(../my:field8, (../my:field22 * 365))</description></item><item><title>Adding a date field and a number field to calculate a new date?</title><link>https://www.infopathdev.com:443/forums/thread/115923.aspx</link><pubDate>Tue, 28 Mar 2017 09:11:20 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:115923</guid><dc:creator>ChristinaGateley</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/115923.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=115923</wfw:commentRss><description>&lt;p&gt;Hi, I hope someone can help.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;In my form I have a date&amp;nbsp;field&amp;nbsp;and a number field (this number field represents a year, so if the value is 1 then it equals 1 year).&lt;/p&gt;&lt;p&gt;I want to add these two fields to give me a new date.&amp;nbsp; I&amp;#39;ve tried but I just get a return value of NaN, as you&amp;#39;d expect.&lt;/p&gt;&lt;p&gt;Please can someone help me with the calculation so I get a date value?&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;If it helps, the calculation I have tried so far is:&amp;nbsp; ../my:field8 + (../my:field22 * 365)&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Thank you.&amp;nbsp;&lt;/p&gt;</description></item></channel></rss>