View Full Version : How to query a boolean field?

May 25, 2016, 08:35 AM
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?

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

Patrick Moore
May 27, 2016, 12:25 PM

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)
2) to select elements that have a No value write it as .NOT.JUNCTION->TEST
(click if need larger image)

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
[*=1]Choose the field you wish to see the unique values for
[*=1]Select the Get unique values button to see the entries available.

example - (click if need larger image)
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