<?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: Comparing Dates</title><link>https://www.infopathdev.com:443/forums/thread/22950.aspx</link><pubDate>Mon, 10 Sep 2007 14:49:40 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:22950</guid><dc:creator>cathy</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/22950.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=22950</wfw:commentRss><description>&lt;p&gt;I tried the following code for my requirement. My requirement is to pass the value as &amp;quot;YELLOW&amp;quot; in a text box if the target date is with in 3 days.&lt;/p&gt;&lt;font color="#008080" size="2"&gt;XPathNavigator&lt;/font&gt;&lt;font size="2"&gt; GYR = MainDataSource.CreateNavigator().SelectSingleNode(&lt;/font&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;/my:myFields/my:field154&amp;quot;&lt;/font&gt;&lt;font size="2"&gt;, &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;this&lt;/font&gt;&lt;font size="2"&gt;.NamespaceManager);&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;&lt;/font&gt;&lt;font color="#008080" size="2"&gt;XPathNavigator&lt;/font&gt;&lt;font size="2"&gt; Date1 = MainDataSource.CreateNavigator().SelectSingleNode(&lt;/font&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;/my:myFields/my:field98&amp;quot;&lt;/font&gt;&lt;font size="2"&gt;, &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;this&lt;/font&gt;&lt;font size="2"&gt;.NamespaceManager);&lt;/p&gt;&lt;/font&gt;&lt;font color="#008080" size="2"&gt;DateTime&lt;/font&gt;&lt;font size="2"&gt; tempdate,today;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;tempdate = Date1.ValueAsDateTime;&lt;/p&gt;today = &lt;/font&gt;&lt;font color="#008080" size="2"&gt;DateTime&lt;/font&gt;&lt;font size="2"&gt;.Now;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;&lt;/font&gt;&lt;font color="#008080" size="2"&gt;TimeSpan&lt;/font&gt;&lt;font size="2"&gt; ts = tempdate - today;&lt;/p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;string&lt;/font&gt;&lt;font size="2"&gt; days = ts.Days.ToString();&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;if&lt;/font&gt;&lt;font size="2"&gt; ((days == &lt;/font&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;3&amp;quot;&lt;/font&gt;&lt;font size="2"&gt;) || (days == &lt;/font&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;2&amp;quot;&lt;/font&gt;&lt;font size="2"&gt;) || (days== &lt;/font&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;1&amp;quot;&lt;/font&gt;&lt;font size="2"&gt;) || (days== &lt;/font&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;0&amp;quot;&lt;/font&gt;&lt;font size="2"&gt;))&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;{&lt;/p&gt;GYR.SetValue(&lt;/font&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;Yellow&amp;quot;&lt;/font&gt;&lt;font size="2"&gt;);&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;This code is giving me the error at line tempdate=Date1.ValueAsDateTime&amp;nbsp; as follows&lt;/p&gt;
&lt;p&gt;&amp;quot;The string &amp;#39;&amp;#39; is not a valid AllXsd value.&amp;quot;&lt;/p&gt;
&lt;p&gt;Why I am getting this message?&lt;/p&gt;&lt;/font&gt;</description></item><item><title>Re: Comparing Dates</title><link>https://www.infopathdev.com:443/forums/thread/22941.aspx</link><pubDate>Mon, 10 Sep 2007 07:46:35 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:22941</guid><dc:creator>Kalyan Gaddam</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/22941.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=22941</wfw:commentRss><description>&lt;p&gt;Hello&lt;/p&gt;
&lt;p&gt;Please go through this link&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.infopathdev.com/forums/p/1192/1911.aspx#1911"&gt;http://www.infopathdev.com/forums/p/1192/1911.aspx#1911&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I hope it will help you&lt;/p&gt;</description></item><item><title>Comparing Dates</title><link>https://www.infopathdev.com:443/forums/thread/22924.aspx</link><pubDate>Fri, 07 Sep 2007 18:18:27 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:22924</guid><dc:creator>cathy</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/22924.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=22924</wfw:commentRss><description>&lt;p&gt;Hi, &lt;/p&gt;
&lt;p&gt;I have two DateTime picker controls Date1 and Date2. How can I compare these two dates in VSTA? I need to pass some data to a text box depending on this comparision. How to do that using code?&lt;/p&gt;
&lt;p&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>