<?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>Newbie Questions</title><link>https://www.infopathdev.com:443/forums/39.aspx</link><description>New to InfoPath? Search to see if your question has already been answered. If it has not, then ask it here or the appropriate topic forum.</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: Yet another if-else statement in infopath 2010 form</title><link>https://www.infopathdev.com:443/forums/thread/94048.aspx</link><pubDate>Sat, 02 Nov 2013 14:34:09 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:94048</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/94048.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=94048</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;Where are you putting this statement? Is part of this a condition, and the rest the formula you are using? Because InfoPath doesn&amp;#39;t have &amp;quot;if - else&amp;quot; in rules....You&amp;#39;d need one condition for NReparacao =  substring-before(now(), &amp;quot;-&amp;quot;) and then a rule to set the field&amp;#39;s value (with the checkbox to stop running rules if this condition is met marked), then another rule to set it to the other value. InfoPath formulas also do not use semicolons. &lt;/p&gt;</description></item><item><title>Yet another if-else statement in infopath 2010 form</title><link>https://www.infopathdev.com:443/forums/thread/94015.aspx</link><pubDate>Thu, 31 Oct 2013 14:53:59 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:94015</guid><dc:creator>darklordpt</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/94015.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=94015</wfw:commentRss><description>Hi all,

I´ve a simple, i hope, question.

I´m trying to compare a year in a form published in a Sharepoint library with the current year (substring-before(now(); &amp;quot;-&amp;quot;))

I´ve the following code in a rule of a button.

    if (NReparacao =  substring-before(now(); &amp;quot;-&amp;quot;))

 	NRef = máx(NRef ) + 1
   else
        NRef    = &amp;quot;001&amp;quot;

But i´m getting the following error


Expected value type: end-of-string ! 

Real value: name

if (my:NReparacao =  substring-before(now(); &amp;quot;-&amp;quot;))
  --&amp;gt;my:NRef</description></item></channel></rss>