<?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>setting up a rule for a date field of type text</title><link>https://www.infopathdev.com:443/forums/thread/99026.aspx</link><pubDate>Tue, 09 Sep 2014 17:15:30 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:99026</guid><dc:creator>cafescott</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/99026.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=99026</wfw:commentRss><description>&lt;p&gt;Hello,&lt;br /&gt;&lt;br /&gt;We have a form that is in production.&amp;nbsp; One of the fields is a date field.&amp;nbsp; However, in the schema it has a data type of text.&amp;nbsp; I have been asked to add a rule that changes the font to red if the date value has expired; i.e., is less than the current date.&amp;nbsp; Is this possible?&lt;br /&gt;&lt;br /&gt;I have found that if I try to change the schema data type to date, and open the form with live data, that the form shows a dashed rectangle around the field with the message, &amp;quot;Only date allowed.&amp;quot;&amp;nbsp; The dashed rectangle and the message go away if I change the schema data type back to text.&lt;br /&gt;&lt;br /&gt;So, I keep the schema as text.&amp;nbsp; When I try to add the formatting rule, there is no way to convert the date as a text field to a date type.&amp;nbsp; Too bad InfoPath doesn&amp;#39;t allow type conversions.&amp;nbsp; &lt;br /&gt;&lt;br /&gt;I also don&amp;#39;t see a way to parse out the text making up the date field in the rules dialog.&amp;nbsp; I&amp;#39;d like to do something like this:&lt;br /&gt;substring ( expiration_date, 7, 4) &amp;lt; substring ( today(), 7,4) AND&lt;br /&gt;substring ( expiration_date, 1, 2) &amp;lt; substring ( today(), 1,2) AND&lt;br /&gt;substring ( expiration_date, 4, 2) &amp;lt; substring ( today(), 4, 2)&lt;br /&gt;&lt;br /&gt;Unfortunately, I don&amp;#39;t see a way for InfoPath to allow the substring on the field (expiration_date).&amp;nbsp; So, before I completely give up, does anyone have a solution?&lt;br /&gt;&lt;br /&gt;Thanks,&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item></channel></rss>