<?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>Re: SQL Question(Group By)</title><link>https://www.infopathdev.com:443/forums/thread/26273.aspx</link><pubDate>Thu, 07 Feb 2008 20:37:27 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:26273</guid><dc:creator>m181354</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/26273.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=47&amp;PostID=26273</wfw:commentRss><description>&lt;p&gt;I created a SQL query with a Group By clause using Toad for SQL Server.&amp;nbsp; It worked great.&amp;nbsp;The query is below.&amp;nbsp; But when I run the query&amp;nbsp;in InfoPath, &amp;nbsp;I get the&amp;nbsp;error message below. &lt;strong&gt;Does that mean InfoPath does not support the Group By clause?&lt;/strong&gt;&amp;nbsp; I could create a view but I need to pass in variables from the form. &lt;/p&gt;
&lt;p&gt;The following error occurred:&lt;/p&gt;
&lt;p&gt;The query method on the Document object failed.&lt;br /&gt;InfoPath cannot run the specified query.&lt;br /&gt;No query fields have been generated because the specified SQL statement is too complex for InfoPath to parse.&lt;br /&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;SELECT [LaborSummary].PROGRAM, [LaborSummary].OBS, [LaborSummary].ECAM, SUM ([LaborSummary].SV_HRS) as SV_TOTAL&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;from [&lt;/strong&gt;&lt;strong&gt;LaborSummary] as [LaborSummary]&amp;nbsp;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;where ([LaborSummary].PROGRAM = &amp;#39;EA18GSDD&amp;quot;) and ([LaborSummary].ECAM Like&amp;nbsp;&amp;quot;1%&amp;quot;) &lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;group by [LaborSummary].PROGRAM, [LaborSummary].OBS, [LaborSummary].ECAM&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>Re: SQL Question(Group By)</title><link>https://www.infopathdev.com:443/forums/thread/26260.aspx</link><pubDate>Thu, 07 Feb 2008 15:41:03 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:26260</guid><dc:creator>Matt Faus</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/26260.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=47&amp;PostID=26260</wfw:commentRss><description>&lt;p&gt;Hi Steve,&lt;/p&gt;
&lt;p&gt;The error message is troubling and it might mean InfoPath does not understand the Group By clause.&amp;nbsp; However, you do have a problem with the query.&lt;/p&gt;
&lt;p&gt;When using the Group By clause, you must include all columns that you select.&amp;nbsp; So, in your query, you must either remove ECAM from the select statement, or add it in the group by clause.&lt;/p&gt;
&lt;p&gt;In general, I would suggest that when you are formulating your queries you try them in SQL Server Management studio first, and then once you have them perfected there, transfer them to InfoPath.&amp;nbsp; If you had done this in this scenario, the error message from SQL Server would have said almost exactly what I did above.&lt;/p&gt;</description></item><item><title>Re: SQL Question(Group By)</title><link>https://www.infopathdev.com:443/forums/thread/26255.aspx</link><pubDate>Thu, 07 Feb 2008 14:49:49 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:26255</guid><dc:creator>Clay Fox</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/26255.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=47&amp;PostID=26255</wfw:commentRss><description>&lt;p&gt;Hey Steve.&lt;/p&gt;
&lt;p&gt;If&amp;nbsp; SQL query works in SQL then it should work anywhere.&lt;/p&gt;
&lt;p&gt;You have three fields in your select but only one is a sum. For Group By to work you can only have one field that is not summed or have a function to it and you must group on that field.&lt;/p&gt;</description></item><item><title>SQL Question(Group By)</title><link>https://www.infopathdev.com:443/forums/thread/26249.aspx</link><pubDate>Thu, 07 Feb 2008 13:25:19 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:26249</guid><dc:creator>m181354</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/26249.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=47&amp;PostID=26249</wfw:commentRss><description>&lt;p&gt;&lt;strong&gt;I have a SQL statement with a Group By clause that get the following error:&lt;/strong&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The following error occurred:&lt;/p&gt;
&lt;p&gt;The query method on the Document object failed.&lt;br /&gt;InfoPath cannot run the specified query.&lt;br /&gt;No query fields have been generated because the specified SQL statement is too complex for InfoPath to parse.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Does anyone know how to code a SQL statement with a Group By clause this get this to work in InfoPath?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;SQL statement below:&lt;/strong&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;quot;select ECAM, OBS, sum(SV_HRS) as SV_HRS_TOTAL &amp;quot;; &lt;/p&gt;
&lt;p&gt;&amp;quot;from &amp;quot;; &lt;/p&gt;
&lt;p&gt;&amp;quot;[LaborSummary] as [LaborSummary] &amp;quot;; &lt;/p&gt;
&lt;p&gt;&amp;quot;where (PROGRAM = &amp;#39;&amp;quot; + programPrefix + &amp;quot;&amp;#39; and LaborSummary.[ECAM] Like &amp;#39;&amp;quot; + ecamPrefix + &amp;quot;%&amp;#39;)&amp;nbsp; &amp;quot;;&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;quot;group by OBS &amp;quot;; &lt;/p&gt;</description></item></channel></rss>