<?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>Code</title><link>https://www.infopathdev.com:443/forums/45.aspx</link><description /><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: Datediff ?</title><link>https://www.infopathdev.com:443/forums/thread/14291.aspx</link><pubDate>Sun, 12 Feb 2006 16:52:17 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:14291</guid><dc:creator>rg66</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/14291.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=14291</wfw:commentRss><description>Just found out what I was missing!&lt;br /&gt;&lt;br /&gt;I started the form and the editor in JScript and not as VBScript.  So I will redo the form in VBScript.&lt;br /&gt;&lt;br /&gt;Will test your script out then.  Thank you!&lt;br /&gt;&lt;br /&gt;Robert</description></item><item><title>Re: Datediff ?</title><link>https://www.infopathdev.com:443/forums/thread/14290.aspx</link><pubDate>Sun, 12 Feb 2006 16:46:14 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:14290</guid><dc:creator>rg66</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/14290.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=14290</wfw:commentRss><description>sandeep,&lt;br /&gt;&lt;br /&gt;thank you for the code script.&lt;br /&gt;&lt;br /&gt;Just one question:  Do I have to place this in the script.js file?  Or is there a different place I have to use?&lt;br /&gt;&lt;br /&gt;Robert</description></item><item><title>Re: Datediff ?</title><link>https://www.infopathdev.com:443/forums/thread/14289.aspx</link><pubDate>Sun, 12 Feb 2006 12:44:26 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:14289</guid><dc:creator>sandeep</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/14289.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=14289</wfw:commentRss><description>Hi rg66&lt;br /&gt;&lt;br /&gt;Try this VBscript code&lt;br /&gt;&lt;br /&gt;Dim date_from &lt;br /&gt;Dim date_to &lt;br /&gt;Dim dt1Val&lt;br /&gt;Dim dt2Val&lt;br /&gt;Dim daysElapsed&lt;br /&gt;&lt;br /&gt;Set date_from = XDocument.DOM.selectSingleNode("/my:myFields/my:date_from")&lt;br /&gt;Set date_to = XDocument.DOM.selectSingleNode("/my:myFields/my:date_to")&lt;br /&gt;&lt;br /&gt;dt1Val = CDate(date_from.Text)&lt;br /&gt;dt2Val = CDate(date_to.Text)&lt;br /&gt;&lt;br /&gt;daysElapsed = DateDiff("d", dt1Val, dt2Val)&lt;br /&gt;&lt;br /&gt;XDocument.DOM.selectSingleNode("/my:myFields/my:field3").text = daysElapsed&lt;br /&gt;&lt;br /&gt;Thanks&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Sandeep&lt;br /&gt;InfoPath Dev India</description></item><item><title>Re: Datediff ?</title><link>https://www.infopathdev.com:443/forums/thread/14288.aspx</link><pubDate>Sun, 12 Feb 2006 10:00:36 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:14288</guid><dc:creator>rg66</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/14288.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=14288</wfw:commentRss><description>Matt,&lt;br /&gt;&lt;br /&gt;thank you!&lt;br /&gt;&lt;br /&gt;But I am trying to get the basic first and I am struggling here.&lt;br /&gt;&lt;br /&gt;Can you recomment a jscript book in correlation with infopath which explains how to use jscript in infopath.&lt;br /&gt;&lt;br /&gt;I am currently trying to make a OnAfterChange Procedure and what I trying to do is read an entry from a textfield and write it in a different one.&lt;br /&gt;&lt;br /&gt;I am getting kind of frustrated as I have search google now and I even have a book from Microsoft, which has helped me to get started but now I need to write a script and I have no idea how to do that.  The documentation is really bad, I have to say.&lt;br /&gt;&lt;br /&gt;Any help?&lt;br /&gt;&lt;br /&gt;Robert</description></item><item><title>Re: Datediff ?</title><link>https://www.infopathdev.com:443/forums/thread/14287.aspx</link><pubDate>Sat, 11 Feb 2006 18:42:55 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:14287</guid><dc:creator>Matt Faus</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/14287.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=14287</wfw:commentRss><description>Check out this awesome tutorial:&lt;br /&gt;&lt;br /&lt;a target="_blank" href=http://enterprise-solutions.swits.net/infopath/adding-time-calculating-differences.htm&gt;http://enterprise-solutions.swits.net/infopath/adding-time-calculating-differences.htm&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;---------------&lt;br /&gt;Matt Faus&lt;br /&gt;InfoPath Dev Texas&lt;br /&gt;</description></item><item><title>Datediff ?</title><link>https://www.infopathdev.com:443/forums/thread/12772.aspx</link><pubDate>Sat, 11 Feb 2006 17:10:21 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:12772</guid><dc:creator>rg66</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/12772.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=12772</wfw:commentRss><description>Hello,&lt;br /&gt;&lt;br /&gt;I have two date fields which are called date_from and date_to.  I want to calculate the datediff from these two fields.&lt;br /&gt;&lt;br /&gt;WHat I need to know is:&lt;br /&gt;&lt;br /&gt;1. How do I read the entry from both fields in jscipt or vbscribt?&lt;br /&gt;2. Make the calculation, is Datediff available om both script level?&lt;br /&gt;3. Return/write the result in another field within the form&lt;br /&gt;&lt;br /&gt;Can some one help or direct me?&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;&lt;br /&gt;Robert</description></item></channel></rss>