<?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>Newbie Questions</title><link>https://www.infopathdev.com:443/forums/39.aspx</link><description>New to InfoPath? Search to see if your question has already been answered. If it has not, then ask it here or the appropriate topic forum.</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: Pull last record out of a SQL database</title><link>https://www.infopathdev.com:443/forums/thread/53939.aspx</link><pubDate>Wed, 21 Apr 2010 03:54:53 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:53939</guid><dc:creator>Aruna Akella</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/53939.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=53939</wfw:commentRss><description>&lt;p&gt;Hi Bryan,&lt;/p&gt;
&lt;p&gt;You can do it by changing the SQL command in the data connection wizard - click on the &amp;#39;Edit SQL...&amp;#39; button in the data connection wizard, and enter the following command &lt;/p&gt;
&lt;p&gt;Select TOP 1 * from &amp;lt;TableName&amp;gt; order by &amp;#39;Field1&amp;#39; desc.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Pull last record out of a SQL database</title><link>https://www.infopathdev.com:443/forums/thread/53931.aspx</link><pubDate>Wed, 21 Apr 2010 00:50:36 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:53931</guid><dc:creator>brjan999</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/53931.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=53931</wfw:commentRss><description>&lt;p&gt;Hi Everyone,&lt;/p&gt;
&lt;p&gt;Is there a way to set a field(s) to the last record of a database.&amp;nbsp; Let&amp;#39;s say that I have five database lines:&lt;/p&gt;
&lt;p&gt;ID&amp;nbsp;&amp;nbsp;&amp;nbsp; Field1&amp;nbsp; &lt;/p&gt;
&lt;p&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; A&lt;br /&gt;2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; B&lt;br /&gt;3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; C&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I want my field in infopath to query the database and pull the last value in the database, which in this case would be C.&amp;nbsp; Any ideas?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Thanks in advance,&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;Bryan&lt;/p&gt;</description></item></channel></rss>