Querying two fields based on one request - InfoPath Dev
in

InfoPath Dev

Querying two fields based on one request

Last post 07-19-2010 01:21 PM by oldradio99. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 07-13-2010 05:47 AM

    Querying two fields based on one request

    I have been mulling this over for about a week and can't seem to come up with a logical approach.

    I have ID#'s stored in two different fields in a SQL database; fields a1 and b1.

    Normally I would have a1 in the IP query box and that would search a1.  A nice 1 for 1 relationship.

    But now I (actually my end users) would like one field (call it c1) to look at a1 and b1 and return any records where xxxx exists in either a1 or b1.

    I can create a SQL view of the data if necessary and modify data there if cant be done in IP.

    Any ideas are welcome.  This Forum has alwasy been good to me.

     

     

    Thank you for your Help.

    Art
  • 07-14-2010 03:29 PM In reply to

    Re: Querying two fields based on one request

    Hi:

    Does the form have to submit to the DB? I think if you build the form off a SQL view, you could do this, but if you build off a view you won't be able to submit....

    Otherwise, I fear you may have to modify the query in code....

    Hilary Stoupa

  • 07-17-2010 07:46 AM In reply to

    • Skarn
    • Top 50 Contributor
      Male
    • Joined on 04-20-2008
    • Australia
    • Posts 198

    Re: Querying two fields based on one request

    Go to Data Connections - main connection, and 'edit SQL' - see if you can't figure out how to put a WHERE clause on it that looks at the values of both a1 and b1 and see if this allows you to accomplish - if not - I have my own approach using jScript. Can you use jScript?

  • 07-19-2010 01:21 PM In reply to

    Re: Querying two fields based on one request

    Skarn:

    Go to Data Connections - main connection, and 'edit SQL' - see if you can't figure out how to put a WHERE clause on it that looks at the values of both a1 and b1 and see if this allows you to accomplish - if not - I have my own approach using jScript. Can you use jScript?

    The trouble as I see it is that the typical "where" clause is not in the SQL query of the data connection but inherent in the IP form itself. Adding a where clause would just limit the data available to the form.

    The data connection to the table has query fields and data fields and neither can be manipulated.

    Maybe there is something in the source files that woudl let me manipulate but have not found a solution yet.

     

     

    Thank you for your Help.

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