<?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: Setting a Date Picker control with a rule as Text produces error</title><link>https://www.infopathdev.com:443/forums/thread/88496.aspx</link><pubDate>Fri, 29 Mar 2013 13:08:16 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:88496</guid><dc:creator>ErnestoM</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/88496.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=88496</wfw:commentRss><description>&lt;p&gt;You may have a data type issue. As the article states:&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;Depending on whether your date picker control is set to accept dates or dates and times, you must &lt;a href="http://www.bizsupportonline.net/infopath2003/date-time-basics-infopath.htm"&gt;use the appropriate date format&lt;/a&gt; when entering the dates for the years. Here, my date picker control accepts only dates, so I used &lt;strong&gt;1995&lt;/strong&gt; as the &lt;strong&gt;Display name&lt;/strong&gt; and &lt;strong&gt;1995-01-01&lt;/strong&gt; as the &lt;strong&gt;Value&lt;/strong&gt; when adding an entry for the year 1995 to my drop-down list box.&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;Another option might be: if the user changes the Year dropdown, you first clear the DatePicker control (set it to blank), and then run the rest of the rules. This guarantees that every time the rules execute, they are running in the same scenario: a blank DatePicker.&lt;/p&gt;&lt;p&gt;Good luck.&lt;/p&gt;</description></item><item><title>Setting a Date Picker control with a rule as Text produces error</title><link>https://www.infopathdev.com:443/forums/thread/88479.aspx</link><pubDate>Thu, 28 Mar 2013 20:40:49 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:88479</guid><dc:creator>AlexK</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/88479.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=88479</wfw:commentRss><description>I have a Date Picker where I need to set its year with a rule based on a dropdown of years, similar to this: http://www.bizsupportonline.net/blog/2009/04/pre-select-year-infopath-date-picker-control/
&lt;br /&gt;
&lt;br /&gt;

Using substrings to get the day and month, I manually set the Date Picker using the formula: concat(number(substring(datePicker, 6, 2)), &amp;quot;/&amp;quot;, number(substring(datePicker, 9, 2)), &amp;quot;/&amp;quot;, yearSelection)
&lt;br /&gt;
&lt;br /&gt;

This only works halfway, though. It seems InfoPath does not like its Date Picker to be set as text. When the rule runs once, it&amp;#39;s fine and properly sets the control to show with the new year, day and month with slashes intact. 

&lt;br /&gt;
&lt;br /&gt;
BUT, when I select another year and the rule runs again, it populates the Day and Month with junk numbers (or NaNs) and highlights the control red because it thinks it is not a date type. Is there a way in my rule to convert the string as a date type to work around this? Or this is another problem altogether?</description></item></channel></rss>