<?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: Conditional count() using dates</title><link>https://www.infopathdev.com:443/forums/thread/96085.aspx</link><pubDate>Mon, 24 Feb 2014 07:57:15 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:96085</guid><dc:creator>L Mac</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/96085.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=96085</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;Jimmy,&lt;/p&gt;&lt;p&gt;&amp;nbsp;Thanks. I&amp;#39;ll insert that when they ask me for the next set of changes to that form.&lt;/p&gt;&lt;p&gt;L Mac &lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Conditional count() using dates</title><link>https://www.infopathdev.com:443/forums/thread/96079.aspx</link><pubDate>Sun, 23 Feb 2014 16:39:00 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:96079</guid><dc:creator>Jimmy</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/96079.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=96079</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;Hi L Mac,&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sorry that nobody responded to your question sooner, but once you&amp;#39;ve got all your dates into yyyy-MM-dd format, the formula to use is much simpler than what you&amp;#39;ve got there. It&amp;#39;s simply the following:&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;count(xdXDocument:GetDOM(&amp;quot;Timecards&amp;quot;)/dfs:myFields/dfs:dataFields/d:Timecards[translate(@StartDate, &amp;#39;T:-&amp;#39;, &amp;#39;&amp;#39;) &amp;gt; translate(xdDate:AddDays(xdDate:Today(), -365), &amp;#39;T:-&amp;#39;)]&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;That should do it!&lt;/p&gt;</description></item><item><title>Re: Conditional count() using dates</title><link>https://www.infopathdev.com:443/forums/thread/96077.aspx</link><pubDate>Fri, 21 Feb 2014 23:19:34 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:96077</guid><dc:creator>L Mac</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/96077.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=96077</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: Conditional count() using dates</title><link>https://www.infopathdev.com:443/forums/thread/95445.aspx</link><pubDate>Mon, 27 Jan 2014 08:50:19 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:95445</guid><dc:creator>L Mac</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/95445.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=95445</wfw:commentRss><description>&lt;p&gt; 
I think that I have found the issue......&amp;nbsp;&amp;nbsp; I have one date in Format :&amp;nbsp; dd/mm/yyyy&amp;nbsp;&amp;nbsp; and the other is&amp;nbsp;&amp;nbsp;&amp;nbsp; yyyy-mm-dd &lt;/p&gt;&lt;p&gt;Now that I have that part straight in my head can anyone help with the concat( substring-before&amp;nbsp; and substring-after) to reverse the first date??&lt;/p&gt;&lt;p&gt;Then I can translate() to get a number that might return a valid count.&lt;/p&gt;</description></item><item><title>Conditional count() using dates</title><link>https://www.infopathdev.com:443/forums/thread/95433.aspx</link><pubDate>Sun, 26 Jan 2014 06:06:25 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:95433</guid><dc:creator>L Mac</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/95433.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=95433</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;I am having issues with counting data returned from an Access DB Table using InfoPath 2010.&lt;/p&gt;&lt;p&gt;The data source (Timecards) is secondary.&amp;nbsp; I need to filter out all data greater than 12 months old. &lt;/p&gt;&lt;p&gt;So far I have xPath as follows:&lt;/p&gt;&lt;p&gt;&amp;nbsp;count(xdXDocument:GetDOM(&amp;quot;Timecards&amp;quot;)/dfs:myFields/dfs:dataFields/d:Timecards[@NotesMon = &amp;quot;A&amp;quot; and @ID = current() &lt;b&gt;and substring-before(@StartDate, &amp;quot; &amp;quot;) &amp;gt; xdDate:AddDays(xdDate:Today(), -365)&lt;/b&gt;])&lt;/p&gt;&lt;p&gt;The first part returns a count as expected, the last part (&lt;b&gt;BOLD&lt;/b&gt;) is what I am having issues with. It draws no errors, but returns a value of zero&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Please help. &lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;br /&gt;&lt;/p&gt;</description></item></channel></rss>