<?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: Count a field based on date</title><link>https://www.infopathdev.com:443/forums/thread/117173.aspx</link><pubDate>Tue, 05 Sep 2017 10:39:31 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:117173</guid><dc:creator>RecoStar</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/117173.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=117173</wfw:commentRss><description>I managed to get this sorted :) Thanks or the help Hilary :)</description></item><item><title>Re: Count a field based on date</title><link>https://www.infopathdev.com:443/forums/thread/117121.aspx</link><pubDate>Tue, 29 Aug 2017 15:04:37 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:117121</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/117121.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=117121</wfw:commentRss><description>A separate field? Are you meaning just that the time is shown in a different control? Change the CreateDate date picker to a text box. Set the format to show the XML value. I&amp;#39;d bet that your data from SQL is yyyy/MM/ddTHH:mm:ss and that to compare your two dates, you need to use substring-before on your SQL data to get the date only.</description></item><item><title>Re: Count a field based on date</title><link>https://www.infopathdev.com:443/forums/thread/117115.aspx</link><pubDate>Tue, 29 Aug 2017 08:09:10 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:117115</guid><dc:creator>RecoStar</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/117115.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=117115</wfw:commentRss><description>Hi Hilary, thanks for your reply. Yes the Xpath filter comparing &amp;quot;my:MonDate&amp;quot; with &amp;quot;@CreateDate&amp;quot;. The date formats are correct, as they are both dd/mm/yyyy. Yeah the SQL database holds the time value as well, but in a separate field with in @CreateDate. I have tried use both a text field set to a whole number and a calculated value and both will not calculate the number of occurrences.

When I have the @CreateDate present in a repeating table, and use a filter on the repeating table: &amp;quot;CreateDate  WeekDateEnd = Hide this control&amp;quot; and select the dates I want it only shows the dates selected which is correct, however it still does not count the amount of instances. Issue is just with it counting how many are displayed.</description></item><item><title>Re: Count a field based on date</title><link>https://www.infopathdev.com:443/forums/thread/117101.aspx</link><pubDate>Fri, 25 Aug 2017 22:00:35 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:117101</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/117101.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=117101</wfw:commentRss><description>When you say the date validation, do you maybe mean the part of the XPath filter comparing &amp;quot;my:MonDate&amp;quot; with &amp;quot;@CreateDate&amp;quot;? One thought I have is that your date formats may not be the same. So, on your form, drag the @CreateDate onto the canvas. Make sure you are displaying a text box. Set the format to display the actual value. Do the same with MonDate. Do they match? Or does your SQL date include time?</description></item><item><title>Count a field based on date</title><link>https://www.infopathdev.com:443/forums/thread/117096.aspx</link><pubDate>Fri, 25 Aug 2017 15:25:43 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:117096</guid><dc:creator>RecoStar</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/117096.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=117096</wfw:commentRss><description>Hello,

I am trying to count a field based on a date. So I have a SQL database which holds data, in that data we have a status field. We are trying to use a calculated value to count the instance of the data depending if the create date matches a selected date and if two instances of the field match. Here is what I have so far:

count(@CurrentIncidentStatusId[(@CreateDate = MonDate) and (. = &amp;quot;OPEN&amp;quot; or . = &amp;quot;REFR&amp;quot;)])

count(xdXDocument:GetDOM(&amp;quot;SQL Status Data Source&amp;quot;)/dfs:myFields/dfs:dataFields/d:Incident/@CurrentIncidentStatusId[(../@CreateDate = xdXDocument:get-DOM()/my:MAIN/my:VisualData/my:VisualDataDates/my:DayDates/my:MonDate) and (. = &amp;quot;OPEN&amp;quot; or . = &amp;quot;REFR&amp;quot;)])

I will break it down, so the CurrentIncidentStatusID can be 1 of 7 options, but only want it to check if OPEN or REFR. The CreateDate is when the incident was created, and the MonDate is a date picker selected to query against the CreateDate.

Works find if I take out the date validation, but need it so it counts for that date selected. 

Any ideas?

Thanks</description></item></channel></rss>