Filter based on part of a word? - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Filter based on part of a word?

Last post 03-22-2012 03:37 AM by Jo-Anne Alfafara. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 02-24-2012 09:37 AM

    • Jtcom
    • Top 500 Contributor
    • Joined on 06-16-2011
    • Posts 34

    Filter based on part of a word?

    I am using the query builder in DBXL 2.5 to try and create a search to pull data from a SLQ data base.  What I want to be able to do is to have several fields in the form that the data is filtered based on, with a button to run the query when they are filled in.  In the query builder document I think I see how to do this using several logical operators, and/or several comparisons and logical sub-operators.  The problem, I can only see a way to filter based on words in my new form using ‘equal’ where the staff using the form would have to get the names filtered by exactly right.  I thought ‘contains’ would be the perfect solution, but it will not let me base that on a field in my new form.  

    Is there a way around this with query builder?  Can I have filters based on part of a name contained in the database, and not the complete name exactly correct?  If not is there some other way to accomplish this other than custom code, qrules maybe? Thank you for your time,J

     

  • 02-29-2012 02:20 PM In reply to

    Re: Filter based on part of a word?

    Have you tried the LIKE operator using % as your wild card?

    In order to have CONTAINS work, you will need to have full-text search enabled on your table.

    Anson Hidajat
    Qdabra® Software/ InfoPathDev.com
    The InfoPath Experts – Streamline data gathering to turn process into knowledge.™

  • 03-12-2012 03:59 PM In reply to

    • Jtcom
    • Top 500 Contributor
    • Joined on 06-16-2011
    • Posts 34

    Re: Filter based on part of a word?

    Thanks for the suggestion.  I finally was able to sit down and try to figure out how to proceed using LIKE and ran into some questions.  Does LIKE in this context act the same way as I am told it works in a SQL query, where “%3” or a phrase close to that tells the search to look at the first 3 letters of a word?  Also, using LIKE in the query builder after working on it this afternoon I am still uncertain, how do you indicate the field in my form I want the filtering to be based on when using LIKE, since there is no field selection tool, do you put in an XPath?

      

    Thanks for any tips to point me in the correct direction and have a good day.

     

    J

     

  • 03-22-2012 03:37 AM In reply to

    Re: Filter based on part of a word?

    Hi Jtcom,

    I just want to follow up with you and check to see if you got your query working. The wildcard % will search for any string of characters, in your case, %3 will yield to values containing the number 3. The QueryDB User Manual has the list wildcards you can use for the LIKE operator. About your second question, you can attach a form template to Query Builder. After attaching your form, you can then select a field in your form to base your filter by clicking on "Select Schema Node" for the Value or Column Name. Hope that helps.

    Let us know how it goes.

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