<?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: Function to round time UP to nearest hour?</title><link>https://www.infopathdev.com:443/forums/thread/103901.aspx</link><pubDate>Thu, 10 Sep 2015 14:44:30 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:103901</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/103901.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=103901</wfw:commentRss><description>I&amp;#39;m not sure - I don&amp;#39;t think the round function works like that... unless maybe you changed the &amp;quot;:&amp;quot; to a decimal....?</description></item><item><title>Re: Function to round time UP to nearest hour?</title><link>https://www.infopathdev.com:443/forums/thread/103897.aspx</link><pubDate>Thu, 10 Sep 2015 13:17:41 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:103897</guid><dc:creator>Sailor</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/103897.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=103897</wfw:commentRss><description>Thank you Hilary.  I appreciate you looking.  ElapsedTime is indeed a default value.  And to be 100% honest these formulas are way beyond me too!  I struggled for a long time, and was following an example I saw elsewhere, which did handle the time calculation...but now I need to do the rounding.  I wonder...should I not be able to somehow use a new field to store this is a NUMBER, then use a round function to round up to the nearest 60?</description></item><item><title>Re: Function to round time UP to nearest hour?</title><link>https://www.infopathdev.com:443/forums/thread/103891.aspx</link><pubDate>Wed, 09 Sep 2015 22:00:25 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:103891</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/103891.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=103891</wfw:commentRss><description>Sorry, I&amp;#39;d help but most of those complex time formulas are beyond me.... is ElapsedTime being set by a rule or by a default value? I guess I&amp;#39;m wondering if you can&amp;#39;t check the string after the &amp;quot;:&amp;quot; to see if it is anything other than &amp;quot;00&amp;quot; and then do something to increment the string before the &amp;quot;:&amp;quot;?</description></item><item><title>Re: Function to round time UP to nearest hour?</title><link>https://www.infopathdev.com:443/forums/thread/103840.aspx</link><pubDate>Mon, 07 Sep 2015 04:26:07 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:103840</guid><dc:creator>Sailor</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/103840.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=103840</wfw:commentRss><description>I&amp;#39;m hoping someone will come to my rescue!</description></item><item><title>Function to round time UP to nearest hour?</title><link>https://www.infopathdev.com:443/forums/thread/103831.aspx</link><pubDate>Fri, 04 Sep 2015 14:28:52 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:103831</guid><dc:creator>Sailor</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/103831.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=103831</wfw:commentRss><description>&lt;p&gt;Hello,

Due to InfoPath not being able to add/subtract time out of the box, I spent multiple hours figuring out how to subtract start and end time.  So now I have a result formatted as string, but I want to &lt;strong&gt;ROUND UP&lt;/strong&gt; to the nearest hour.  So for 00:25 I want it rounded to 01:00, and 01:40 to 02:00, etc.  Then I need the sum of this result (they are in a repeating table).  With the results formatted as a string, I don&amp;#39;t imagine I can using the Ceiling function...
&lt;/p&gt;&lt;p&gt;
Here is what I&amp;#39;ve done to create the Elapsed_Time&lt;/p&gt;&lt;p&gt;

concat(substring(concat(substring-before(../my:Total_Minutes div 60, &amp;quot;.&amp;quot;), &amp;quot;:&amp;quot;, ../my:Total_Minutes mod 60), 1, contains(../my:Total_Minutes div 60, &amp;quot;.&amp;quot;) * string-length(concat(substring-before(../my:Total_Minutes div 60, &amp;quot;.&amp;quot;), &amp;quot;:&amp;quot;, ../my:Total_Minutes mod 60))), substring(concat(../my:Total_Minutes div 60, &amp;quot;:&amp;quot;, ../my:Total_Minutes mod 60), 1, not(contains(../my:Total_Minutes div 60, &amp;quot;.&amp;quot;)) * string-length(concat(../my:Total_Minutes div 60, &amp;quot;:&amp;quot;, ../my:Total_Minutes mod 60))))
&lt;/p&gt;&lt;p&gt;
Using the Total_Minutes field&lt;/p&gt;&lt;p&gt;

substring(((substring-before(../my:End_Time, &amp;quot;:&amp;quot;) * 60) + substring-before(substring-after(../my:End_Time, &amp;quot;:&amp;quot;), &amp;quot;:&amp;quot;)) - ((substring-before(../my:Start_Time, &amp;quot;:&amp;quot;) * 60) + substring-before(substring-after(../my:Start_Time, &amp;quot;:&amp;quot;), &amp;quot;:&amp;quot;)), 1, (../my:Start_Time != &amp;quot;&amp;quot; and ../my:End_Time != &amp;quot;&amp;quot;) * string-length(((substring-before(../my:End_Time, &amp;quot;:&amp;quot;) * 60) + substring-before(substring-after(../my:End_Time, &amp;quot;:&amp;quot;), &amp;quot;:&amp;quot;)) - ((substring-before(../my:Start_Time, &amp;quot;:&amp;quot;) * 60) + substring-before(substring-after(../my:Start_Time, &amp;quot;:&amp;quot;), &amp;quot;:&amp;quot;))))&lt;/p&gt;</description></item></channel></rss>