<?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: Counting a repeating table with conditions</title><link>https://www.infopathdev.com:443/forums/thread/96078.aspx</link><pubDate>Fri, 21 Feb 2014 23:20:55 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:96078</guid><dc:creator>L Mac</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/96078.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=96078</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;For those interested - the solution was:&lt;/p&gt;&lt;p&gt;Set all date formats to yyyy-mm-dd (you may need to change the format saved when using Access DB tables)&lt;/p&gt;&lt;p&gt;Convert
 date to integer in a second field using : &amp;nbsp; 
number(concat(substring(string(xdDate:AddDays(xdDate:Today(), -365)), 1,
 4), substring(string(xdDate:AddDays(xdDate:Today(), -365)), 6, 2), 
substring(string(xdDate:AddDays(xdDate:Today(), -365)), 9, 2)))&lt;/p&gt;&lt;p&gt;Note that this returns a value 1 year (365 days) before today&lt;/p&gt;&lt;p&gt;I converted the second date to an integer in the conditional statement using the following :&lt;/p&gt;&lt;p&gt;&amp;nbsp;number(concat(substring(string(@StartDate),
 1, 4), substring(string(@StartDate), 6, 2), 
substring(string(@StartDate), 9, 2))) &lt;br /&gt;&lt;/p&gt;&lt;p&gt;Note that relative xPath has been used. The absolute xPath was used in the first part of the statement&lt;/p&gt;&lt;p&gt;Complete statement used was :&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;count(xdXDocument:GetDOM(&amp;quot;Timecards&amp;quot;)/dfs:myFields/dfs:dataFields/d:Timecards[number(concat(substring(string(@StartDate),
 1, 4), substring(string(@StartDate), 6, 2), 
substring(string(@StartDate), 9, 2))) &amp;gt; 
xdXDocument:get-DOM()/dfs:myFields/my:FormFields/my:CountFields/my:AnotherDate
 and @ID = current() and @NotesSun = &amp;quot;A&amp;quot;])&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Counting a repeating table with conditions</title><link>https://www.infopathdev.com:443/forums/thread/95964.aspx</link><pubDate>Tue, 18 Feb 2014 14:22:30 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:95964</guid><dc:creator>wilkies0106aw</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/95964.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=95964</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;This might help you - http://www.manjuke.com/2011/01/how-to-filter-data-correctly-on.html&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Counting a repeating table with conditions</title><link>https://www.infopathdev.com:443/forums/thread/95956.aspx</link><pubDate>Tue, 18 Feb 2014 01:40:24 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:95956</guid><dc:creator>L Mac</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/95956.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=95956</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;I have a repeating table containing employees timecard details.&amp;nbsp; I need to count the number of absences in the last 12 months for a particular employee.&lt;/p&gt;&lt;p&gt;The count is bound to the employee ID field.&amp;nbsp; I can count absences (&amp;quot;A&amp;quot;) for a chosen employee, but I have a problem when I introduce a date filter.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Please Help&lt;/p&gt;&lt;p&gt;the xPath I have so far is:&lt;/p&gt;&lt;p&gt;count(xdXDocument:GetDOM(&amp;quot;Timecards&amp;quot;)/dfs:myFields/dfs:dataFields/d:Timecards[@NotesSun = &amp;quot;A&amp;quot; and @ID = current() and number(concat(substring(string(xdXDocument:get-DOM()/dfs:myFields/my:FormFields/my:CountFields/my:AnotherDate), 1, 4), substring(string(xdXDocument:get-DOM()/dfs:myFields/my:FormFields/my:CountFields/my:AnotherDate), 6, 2), substring(string(xdXDocument:get-DOM()/dfs:myFields/my:FormFields/my:CountFields/my:AnotherDate), 9, 2))) &amp;gt; number(concat(substring(string(xdXDocument:GetDOM(&amp;quot;Absence&amp;quot;)/dfs:myFields/dfs:dataFields/d:Absence/@AbsenceDate), 1, 4), substring(string(xdXDocument:GetDOM(&amp;quot;Absence&amp;quot;)/dfs:myFields/dfs:dataFields/d:Absence/@AbsenceDate), 6, 2), substring(string(xdXDocument:GetDOM(&amp;quot;Absence&amp;quot;)/dfs:myFields/dfs:dataFields/d:Absence/@AbsenceDate), 9, 2)))]) &lt;br /&gt;&lt;/p&gt;</description></item></channel></rss>