2007 - SQL Database - filtering - InfoPath Dev
in

InfoPath Dev

2007 - SQL Database - filtering

Last post 01-24-2012 09:57 AM by bobga. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 01-24-2012 09:13 AM

    • danli66
    • Not Ranked
      Female
    • Joined on 01-24-2012
    • England
    • Posts 1

    2007 - SQL Database - filtering

    Hi

    I have created a form to be posted onto a SharePoint site, users will access the form select data which will then be submitted and carried through a process by a workflow.  The data that will populate various drop down fields will come from our sql erp database.  The databases are all separate per country but sat on the same server, so my first problem is to be able state in a branch indicator which sql admin I want to populate the drop down lists.  Any ideas?  The alternative I guess would be to create one database from all 6 as a layer which updates daily from the reality??

    Secondly, I have noticed that the database has a lot emply and rubbish fields, I can avoid these with rules when connected so not a problem but any one got any idea on how to only view one line of the same data?  For example multiple fields that state "Herbicides" and I only want to show one in the drop down box

    Any help will be greatly appreciated.

    Thanks

    Lisa

  • 01-24-2012 09:57 AM In reply to

    • bobga
    • Not Ranked
    • Joined on 12-22-2010
    • Posts 9

    Re: 2007 - SQL Database - filtering

    Here's what I've used:

    Go to the data connection for a sql table.  Click on modify table and edit sql.  You will see the sql that has been generated when the data connection was established.  You can edit the sql.  To get unique values for a pull down.  I substituted the following sql statement:

    select "ID","Creditor Counsel" as "Creditor_Counsel" from "dbo"."EO Credit Abuse Master" as "EO_Credit_Abuse_Master" where ID in (select max(ID) from "dbo"."EO Credit Abuse Master" where "Creditor Counsel" = "EO_Credit_Abuse_Master"."Creditor Counsel")       order by "Creditor Counsel"

    Click on test sql statement to see if your sql is correct.

     

    Good luck

Page 1 of 1 (2 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.