<?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: Calculate previous month</title><link>https://www.infopathdev.com:443/forums/thread/64490.aspx</link><pubDate>Wed, 23 Feb 2011 01:04:26 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:64490</guid><dc:creator>Vanessa Larsen</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/64490.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=64490</wfw:commentRss><description>&lt;p&gt;Awesome, thanks so much for your help :-)&lt;/p&gt;</description></item><item><title>Re: Calculate previous month</title><link>https://www.infopathdev.com:443/forums/thread/64428.aspx</link><pubDate>Tue, 22 Feb 2011 07:11:48 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:64428</guid><dc:creator>Jimmy</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/64428.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=64428</wfw:commentRss><description>&lt;p&gt;Rule:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Condition: substring(today(), 6, 2) = 1&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Year = substring(today(), 1, 4) - 1&lt;/p&gt;
&lt;p&gt;Month = 12&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;Condition: substring(today(), 6, 2) != 1&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Year = substring(today(), 1, 4)&lt;/p&gt;
&lt;p&gt;Month = substring(today(), 6, 2) - 1&lt;/p&gt;&lt;/blockquote&gt;&lt;/blockquote&gt;
&lt;p&gt;Or&amp;nbsp;without conditions:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Year = &lt;strong&gt;&lt;u&gt;substring(today(), 1, 4) - (substring(today(), 6, 2) = 1)&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Month = &lt;strong&gt;&lt;u&gt;substring(today(), 6, 2) - 1 + 12 * (substring(today(), 6, 2) = 1)&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;/blockquote&gt;</description></item><item><title>Calculate previous month</title><link>https://www.infopathdev.com:443/forums/thread/64426.aspx</link><pubDate>Tue, 22 Feb 2011 06:57:30 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:64426</guid><dc:creator>Vanessa Larsen</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/64426.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=64426</wfw:commentRss><description>&lt;p&gt;Hi all,&lt;/p&gt;
&lt;p&gt;I&amp;#39;m currently developing a (InfoPath 2010)&amp;nbsp;form where there is the requirement to automatically populate the field with the previous month e.g. January 2011. I know that an easy way to calculate this would be to use today()-30, however this doesn&amp;#39;t cater for months where there are 31 days - and the users typically submit these forms at the end of the month.&lt;/p&gt;
&lt;p&gt;I was hoping someone would know of a smarter (code-free) way to calculate the previous month?&lt;/p&gt;
&lt;p&gt;Cheers,&lt;/p&gt;
&lt;p&gt;Vanessa&lt;/p&gt;</description></item></channel></rss>