Pull last record out of a SQL database - InfoPath Dev
in

InfoPath Dev

Pull last record out of a SQL database

Last post 04-20-2010 08:54 PM by aruna akella. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 04-20-2010 05:50 PM

    Pull last record out of a SQL database

    Hi Everyone,

    Is there a way to set a field(s) to the last record of a database.  Let's say that I have five database lines:

    ID    Field1 

    1       A
    2       B
    3       C

     

    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.  Any ideas?

     Thanks in advance,


    Bryan

  • 04-20-2010 08:54 PM In reply to

    Re: Pull last record out of a SQL database

    Hi Bryan,

    You can do it by changing the SQL command in the data connection wizard - click on the 'Edit SQL...' button in the data connection wizard, and enter the following command

    Select TOP 1 * from <TableName> order by 'Field1' desc.

     

    Aruna Akella
    Qdabra® Software / InfoPathDev.com
    The InfoPath Experts – Streamline data gathering to turn process into knowledge.™
Page 1 of 1 (2 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.