# WHERE Clause in Query for DropDown Box

**URL:** <https://forum.inductiveautomation.com/t/where-clause-in-query-for-dropdown-box/21382>\
**Category:** Ignition\
**Created:** [December 12, 2018, 7:11pm UTC](https://forum.inductiveautomation.com/t/where-clause-in-query-for-dropdown-box/21382 "2018-12-12T19:11:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![paulm1](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paulm1/32/5900_2.png) [@paulm1](https://forum.inductiveautomation.com/u/paulm1)\
**Post date:** [December 12, 2018, 7:11pm UTC](https://forum.inductiveautomation.com/t/where-clause-in-query-for-dropdown-box/21382/1 "2018-12-12T19:11:37Z")

</div>

I have a drop down Box That I populate with the following Data Binding Query.

 ![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/2/262c0d7139e497cf720b1381df63bbfe4576444d.png)

I get the following results.

![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/d/dde7a78911886bb5a5ab130c99dacf016850f0ea.png)

I’m trying to eliminate null cells and also ones with “New Unit” in them.  
I am able to make one clause or the other work but not both of them at the same time.  
When I drop the second condition (OR) and use just the NOT LIKE Clause -

```
WHERE unit1 NOT LIKE "%New Unit"

```

The drop down looks like this -  
 ![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/8/8262f15cc5679ef7a495e4ecaa4b19dfe9171395.png)

Or I can drop the NOT LIKE condition and my dropdown will not display the Blank slot but will have two New Units.

How can I fix my query to sort out both “New Unit” and null cells?

---

<div class="post-metadata">

**Author:** ![ethomason](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ethomason/32/43338_2.png) [@ethomason](https://forum.inductiveautomation.com/u/ethomason)\
**Post date:** [December 12, 2018, 7:23pm UTC](https://forum.inductiveautomation.com/t/where-clause-in-query-for-dropdown-box/21382/2 "2018-12-12T19:23:51Z")

</div>

```auto
WHERE unit1 NOT LIKE "%New Unit%" AND unit1 != " "

```

---

<div class="post-metadata">

**Author:** ![paulm1](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paulm1/32/5900_2.png) [@paulm1](https://forum.inductiveautomation.com/u/paulm1)\
**Post date:** [December 12, 2018, 7:33pm UTC](https://forum.inductiveautomation.com/t/where-clause-in-query-for-dropdown-box/21382/3 "2018-12-12T19:33:59Z")

</div>

That was too easy.  
I was thinking that if I used AND then cell would have to meet both Conditions to not be displayed.  
Thank you.
