<?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: Date Calculation - IP2003</title><link>https://www.infopathdev.com:443/forums/thread/27568.aspx</link><pubDate>Mon, 31 Mar 2008 15:51:56 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:27568</guid><dc:creator>Clay Fox</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/27568.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=27568</wfw:commentRss><description>&lt;p&gt;Hey Tim.&lt;/p&gt;
&lt;p&gt;Why don&amp;#39;t you attach you xsn to a post and then I can take a look at it.&lt;/p&gt;
&lt;p&gt;I am guessing your tomorrow filed should be a date format but I can see if i can get it working.&lt;/p&gt;</description></item><item><title>Re: Date Calculation - IP2003</title><link>https://www.infopathdev.com:443/forums/thread/27566.aspx</link><pubDate>Mon, 31 Mar 2008 12:46:05 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:27566</guid><dc:creator>timjfisher</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/27566.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=27566</wfw:commentRss><description>&lt;p&gt;[ BUMP]&lt;/p&gt;&lt;p&gt;I was wondering if any of you [much smarter than me] folks could take a look at my original post? I would be forever grateful if someone could help me out with this! I don&amp;#39;t imagine it&amp;#39;s too complicated, but I&amp;#39;m just not familiar enough with the programming to figure this out myself.&lt;/p&gt;&lt;p&gt;Thanks again to anyone that takes a look at this!&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Date Calculation - IP2003</title><link>https://www.infopathdev.com:443/forums/thread/26653.aspx</link><pubDate>Thu, 21 Feb 2008 15:42:49 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:26653</guid><dc:creator>barmatt80</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/26653.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=26653</wfw:commentRss><description>&lt;p&gt;Welcome.&amp;nbsp; There is some great information here!&lt;/p&gt;
&lt;p&gt;You are using vbscript, which I have no idea how to do it in vbscript.&amp;nbsp; I have done what you are needing many times before in visual basic not vbscript.&amp;nbsp; Are you confortable with any other languages?&amp;nbsp; Reason I ask this is that you personally could upgrade to InfoPath 2007 and write code that is backwards compatible with all the users on 2003.&amp;nbsp; That is my situation, I know vb, but not vb script or jscript.&amp;nbsp; I got Infopath 2007 for that reason as the slow transition to 2007 is completed here at work.&amp;nbsp; InfoPath 2007 supports: JScript, VBScript, C# and VB, which can be used in infopath 2003.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;I am sure others will chime in and help you out, but if you need help on the vb(not script)&amp;nbsp;side of it I am more than happy to help you.&lt;/p&gt;
&lt;p&gt;Also thanks for the above work week solution, I have not had a reason to use such event yet, but I know I will in the future.&lt;/p&gt;</description></item><item><title>Date Calculation - IP2003</title><link>https://www.infopathdev.com:443/forums/thread/26643.aspx</link><pubDate>Thu, 21 Feb 2008 11:20:26 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:26643</guid><dc:creator>timjfisher</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/26643.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=26643</wfw:commentRss><description>&lt;p&gt;Hi! Thanks in advance for any help!&amp;nbsp;&lt;/p&gt;&lt;p&gt;What I want is a &amp;quot;need by&amp;quot; date (&amp;quot;DateNeededBy&amp;quot;) that the user chooses, but that date can not be a weekend nor can it be in the past, today, or tomorrow.&lt;/p&gt;&lt;p&gt;I&amp;#39;ve solved the weekend issue creating a &amp;quot;DayOfWeekNumber&amp;quot; variable and setting up a rule in &amp;quot;DateNeededBy&amp;quot; to assign an integer value to the day of the week it happens to be. I then used a validation condition to restrict Saturdays and Sundays. Here&amp;#39;s the code if anyone is interested:&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;(number(substring(., 9, 2)) + floor(((153 * (number(substring(., 6, 2)) + (12 * floor((14 - number(substring(., 6, 2))) / 12)) - 3)) + 2) / 5) + (365 * (number(substring(., 1, 4)) + 4800 - floor((14 - number(substring(., 6, 2))) / 12))) + floor((number(substring(., 1, 4)) + 4800 - floor((14 - number(substring(., 6, 2))) / 12)) / 4) - 32083) mod 7&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;That&amp;#39;s working fine. My issue is preventing dates from the past, today, and tomorrow from being entered. Obviously the following validation does not work...&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;DateNeededBy | is less than or equal to | today()&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;... because that only does the past and today. And I know that I can not use a simple calculation to add a day. I also know that this would be much easier in IP2007 but upgrading is not an option (we&amp;#39;re talking about thousands of users in a corporate environment).&lt;/p&gt;&lt;p&gt;So I&amp;#39;m down to VB code, which I&amp;#39;m not very familiar with.&lt;/p&gt;&lt;p&gt;Thanks to Clay Fox&amp;#39;s information in this post - http://www.infopathdev.com/forums/p/1192/4234.aspx#4234 - I&amp;#39;ve been able to calculate tomorrow&amp;#39;s date and return it to a variable in the form:&lt;/p&gt;&lt;blockquote&gt;Sub XDocument_OnLoad(eventObj)&lt;br /&gt;XDocument.DOM.selectSingleNode(&amp;quot;/my:myFields/my:HiddenVariables/my:Tomorrow&amp;quot;).text = DateAdd(&amp;quot;d&amp;quot;,1,date)&lt;br /&gt;End Sub&lt;/blockquote&gt;&lt;p&gt;&amp;quot;Tomorrow&amp;quot; is a Text(string) data type.&lt;/p&gt;&lt;p&gt;My problem now is that InfoPath doesn&amp;#39;t see this returned information as a real date. When I set the &amp;quot;Tomorrow&amp;quot; variable as a Date(date) data type, I get nothing in my form.&lt;/p&gt;&lt;p&gt;It looks to me like the information that the VB code is outputting is not in the format that InfoPath likes to see as a date. I know that there are differences in formats, so my assumption now is that I need some additional code in VB to convert that VBScript date that&amp;#39;s being generated in the above code to ISO format that InfoPath needs. Is that correct?&lt;/p&gt;&lt;p&gt;Now, here&amp;#39;s where the help comes in :) ! I have NO idea how I would do that. Can anyone help out?&lt;/p&gt;&lt;p&gt;Thank you!&amp;nbsp;&lt;/p&gt;</description></item></channel></rss>