<?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>InfoPath 2010</title><link>https://www.infopathdev.com:443/forums/142.aspx</link><description>Are you exploring new features coming up in 2010? Share information and ask questions here!</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: Infopath Repeating Table for Sharepoint 2010 - xpath to compare several date fields and identify the latest one</title><link>https://www.infopathdev.com:443/forums/thread/100971.aspx</link><pubDate>Mon, 02 Feb 2015 16:27:06 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:100971</guid><dc:creator>AndreasEG</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/100971.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=142&amp;PostID=100971</wfw:commentRss><description>&lt;p&gt;Hi Hilary, great - it worked. I just had to insert &amp;quot;-&amp;quot; into the string again so that it is accepted as date format. Regards Andreas&lt;/p&gt;</description></item><item><title>Re: Infopath Repeating Table for Sharepoint 2010 - xpath to compare several date fields and identify the latest one</title><link>https://www.infopathdev.com:443/forums/thread/100694.aspx</link><pubDate>Wed, 07 Jan 2015 15:15:40 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:100694</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/100694.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=142&amp;PostID=100694</wfw:commentRss><description>&lt;p&gt;What if you took the same approach you would take for a numeric field, but use a translate function to strip the non-numeric chars out of the date? So 2015-01-15 becomes 20150115 and 2014-12-13 becomes 20141213?&lt;/p&gt;</description></item><item><title>Infopath Repeating Table for Sharepoint 2010 - xpath to compare several date fields and identify the latest one</title><link>https://www.infopathdev.com:443/forums/thread/100690.aspx</link><pubDate>Wed, 07 Jan 2015 12:04:59 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:100690</guid><dc:creator>AndreasEG</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/100690.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=142&amp;PostID=100690</wfw:commentRss><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I have a repeated table with 6 date fields in a record&amp;nbsp;and need to determine the latest of these per record.&lt;/p&gt;
&lt;p&gt;For numeric fields this is simple by using the MAX function in default value of the target field: xdMath:Max(../my:dt1 | ../my:dt2 | ../my:dt3 | ../my:dt4 | ../my:dt5 | ../my:dt6)&lt;/p&gt;
&lt;p&gt;Unfortunately, MAX does not work for date fields.&lt;/p&gt;
&lt;p&gt;Any idea how this can be done efficiently?&lt;/p&gt;
&lt;p&gt;I have developed an approach which however seems to me very complicated and I doubt it cannot be done easier:&lt;/p&gt;
&lt;p&gt;The approach is to do pairwise comparisons of dates:&lt;br /&gt;dt12max=maximum(dt1,dt2)&lt;br /&gt;dt34max=maximum(dt3,dt4)&lt;br /&gt;dt56max=maximum(dt5,dt6)&lt;br /&gt;dt1234max=maximum(dt12,dt34)&lt;br /&gt;dtdt123456max=maximum(dt1234,dt56)&lt;/p&gt;
&lt;p&gt;... where each comparison would look like the statement below - which is kind of a if/then statement using the string-compare function for the actual comparison:&lt;br /&gt;concat(substring(string(../my:dt2), 1, number(0 &amp;gt; (msxsl:string-compare(../my:dt1, ../my:dt2))) * string-length(string(../my:dt2))), substring(string(../my:dt1), 1, number(not(0 &amp;gt; (msxsl:string-compare(../my:dt1, ../my:dt2)))) * string-length(string(../my:dt1))))&lt;/p&gt;
&lt;p&gt;This approach works but needs 5 help variables and a long xpath statement in each variables default value.&lt;/p&gt;
&lt;p&gt;I attach the xsn and the xml file. In the third repeated table (group4) DTMax is the target field for the comparison of dt1 to dt6. DTMax12 is the target field for my own complex approach for comparing dates dt1 and dt2.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;Is there a simpler way to perform multiple dates to determine the latest one?&lt;/p&gt;
&lt;p&gt;Regards&lt;br /&gt;Andreas&lt;br /&gt;&lt;/p&gt;</description></item></channel></rss>