<?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>SQL Database Integration</title><link>https://www.infopathdev.com:443/forums/47.aspx</link><description>For questions concerning issues in the integration of SQL and Microsoft InfoPath.</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Filtering results of an SQL data connection query</title><link>https://www.infopathdev.com:443/forums/thread/97529.aspx</link><pubDate>Mon, 19 May 2014 14:51:15 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:97529</guid><dc:creator>fcoulter</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/97529.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=47&amp;PostID=97529</wfw:commentRss><description>&lt;p&gt;I am creating a data connection to an SQL server.  The stock data connection tools works fine, except the table I&amp;#39;m connecting to has 48K rows, and grows constantly.  I&amp;#39;d like to filter the amount of data that is sent.  As such, I have a couple of questions.&amp;nbsp; I don&amp;#39;t want to use code in my solution.&amp;nbsp;I don&amp;#39;t control the SQL database.&amp;nbsp; There is no SOAP defined for the data base.&lt;/p&gt;&lt;p&gt;&amp;nbsp;First, the data I&amp;#39;m querying has a Year field, called &amp;quot;Year&amp;quot;.&amp;nbsp; (A remarkable lack of creativity, I know.)&amp;nbsp;&amp;nbsp;&amp;nbsp;I know that the earlier versions of InfoPath did not allow for adding a parameter into the SQL query.&amp;nbsp; Is this still&amp;nbsp;true for InfoPath 2013?&amp;nbsp; This is not a deal changer, just would make my life easier.&amp;nbsp;&lt;/p&gt;&lt;p&gt;If I can add a parameter, how do I do so?&amp;nbsp;&lt;/p&gt;&lt;p&gt;Second,&amp;nbsp;a quick refresher on SQL query language.&amp;nbsp; What is that I need to add to the code to get only those items with Year = &amp;quot;2014&amp;quot;?&amp;nbsp; How about if I want the year to equal either &amp;quot;2014&amp;quot; or &amp;quot;2015&amp;quot;?&amp;nbsp; How about if I want to filter by year and by a different field (Active = &amp;quot;1&amp;quot;)?&lt;/p&gt;&lt;p&gt;Finally, is there a way to have two different SQL queries defined, using the same field codes, etc.?&amp;nbsp; I&amp;#39;m imagining the form working as follows:&lt;/p&gt;&lt;ol&gt;&lt;li&gt;Two buttons appear on the top of the form.&amp;nbsp; One for 2014, and the second for 2015.&lt;/li&gt;&lt;li&gt;When a button is clicked&lt;/li&gt;&lt;ol&gt;&lt;li&gt;One of two different data queries fires off, requesting either the 2014 or 2015 data.&amp;nbsp; (Basically, identical queries, except one tests for Year = 2014, while the other tests for Year = 2015&lt;/li&gt;&lt;li&gt;The buttons disappear, and the rest of the form appears&lt;/li&gt;&lt;/ol&gt;&lt;li&gt;The rest of the form uses either the 2014 or 2015 query.&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;The multiple queries would lessen the traffic the most, but isn&amp;#39;t at all essential.&amp;nbsp; Even if I can limit the size of the data table to only two years, it will make the form much more responsive.&amp;nbsp; I can then use in-form filtering to bring the size of the data to something even more workable.&lt;/p&gt;&lt;p&gt;&amp;nbsp;Thanks in advance for your help.&amp;nbsp; (Even if all you do is point me in the right direction, it&amp;#39;s still helpful.)&amp;nbsp;&lt;/p&gt;</description></item></channel></rss>