Results 1 to 2 of 2

Thread: How to query a boolean field?

  1. #1

    Join Date
    Jun 2013
    Posts
    11

    How to query a boolean field?

    I have added a 'Boolean' type field to my DB tables in InfoWater, but cannot seem to figure out the correct syntax for a query based on it. I have tried all of the following, and each time I try to validate it says, "Invalid query statement or empty query result". I do have several pipes with ALT1=Yes, so I think it must be a problem with my syntax, or a bug.

    What do I need to do to get this working?
    I'm using InfoWater 12 Update #2 and ArcGIS 10.3.

    Related to this, can I request a feature be added to the query builder to 'Get unique values' like the ArcMap query builder has?

    PIPE->ALT1=YES
    PIPE->ALT1='YES'
    PIPE->ALT1=Yes
    PIPE->ALT1='Yes'
    PIPE->ALT1=TRUE
    PIPE->ALT1='TRUE'
    PIPE->ALT1=1
    PIPE->ALT1='1'
    STR( PIPE->ALT1)='1'
    STR( PIPE->ALT1)='Yes'
    STR( PIPE->ALT1)='YES'
    STR( PIPE->ALT1)='TRUE'
    STR( PIPE->ALT1)='True'

  2. #2
    Forum Moderator

    Innovyze Employee



    Innovyze Employee



    Join Date
    May 2015
    Posts
    420
    Colin,

    Thank you for posting your question. Querying on a Boolean field is a little bit different than normal queries. Boolean type fields can only have a value of 'Yes" or a value of 'No". When creating a query on a field (for example on a junction field called TEST) that is a Boolean type you simply need to put in the query statement as follows:
    Type: Junction
    Field: TEST (Boolean)

    1) To select elements that have Yes values -> JUNCTION->TEST
    (click if need larger image)
    boolianquery-yes.jpg
    2) to select elements that have a No value write it as .NOT.JUNCTION->TEST
    (click if need larger image)
    Boolian query-no.jpg

    We will pass on your feature request to the development team, but please be aware that unfortunately we cannot guarantee that all feature requests will get implemented. However, as an immediate workaround you can use now, we suggest the following:

    A) Join all layer tables -> Use the InfoWater-> Utilities-> Database-> Join All Layer Tables
    -> This will Join the hydraulic, information, and out put fields to the model to the MAP files for each model layer in the Table of Contents so they can be seen in the Attribute table
    B) Open the ArcGIS Selection-> Select by attributes command.
    1. Select the model layer that has the field you wish to find unique values for
    2. Choose the field you wish to see the unique values for
    3. Select the Get unique values button to see the entries available.

    example - (click if need larger image)
    Select by Attributes- unique values.jpg
    C) you will now have the list of unique values you want to obtain.


    Please let us know if you have any further questions on this matter by replying to this post.

    Thank you,
    Patrick Moore

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •