---
category: [Administration & Integrations, Platform and Product Extensions, Platform and Product Extensions/Integration, Administration & Integrations/Custom Integrations & Apps]
keyword: [Extend, Workday Query Language, WQL]
nav: wcp_docs
parent_url: /wcp_docs/
title: WHERE ON
layout: subsection
---

<a id="d261e285"></a>
Specifies the fields to filter from related business objects (RBOs) in the SELECT clause. Workday evaluates expressions in parentheses first in conditional expressions. Use the `AND` and `OR` logical operators to separate conditional expressions in Workday Query Language (WQL).

## <a id="d261e297"></a>Syntax

```
WHERE ON
  relatedBusinessObject1 relatedBusinessObjectField1 = value1  
  AND relatedBusinessObjectField2 IN (instance1, instance2) 
  OR relatedBusinessObjectField3 IN (inst_refId = referenceID)
WHERE ON
  relatedBusinessObject2 relatedBusinessObjectField1 = value1 
```

Omit the braces { } notation for RBO fields.

## <a id="d261e318"></a>Arguments

<table><thead><tr><th><p>Argument</p></th><th><p>Description</p></th></tr></thead><tbody><tr><td><p><code><i>relatedBusinessObject1</i></code></p></td><td><p>The RBO of the fields for which you want to filter results.</p></td></tr><tr><td><p><code><i>relatedBusinessObjectfield1</i>, <i>relatedBusinessObjectfield2</i>, ...<i>relatedBusinessObjectfieldN</i></code></p></td><td><p>The fields of the related business objects for which you want to filter results.</p></td></tr><tr><td><p><code><i>value1</i>, <i>value2</i>, ...<i>valueN</i></code></p></td><td><p>The values of the fields you want to match.</p></td></tr><tr><td><p><code><i>instance1</i>, <i>instance2</i>, ...<i>instanceN</i></code></p></td><td><p>The Workday IDs of the field values you want to match.</p> <p>Workday fails queries with invalid ID formats.</p></td></tr><tr><td><p><code><i>inst_refId</i></code></p></td><td><p>The reference ID type of a field in the conditional expression.</p></td></tr><tr><td><p><code><i>referenceID</i></code></p></td><td><p>The reference ID of the field value you want to match.</p> <p>You can filter by the reference ID with or without double quotes.</p> <p>Examples:</p><ul><li><code>(inst_refId = "referenceID")</code>
</li><li><code>(inst_refId = referenceID)</code>
</li></ul></td></tr></tbody></table><br/>

## <a id="section_wzt_53r_35b"></a>Comparison Operators

<table><thead><tr><th><p>Operator</p></th><th><p>Field Data Type Compatibility</p></th><th><p>Description</p></th></tr></thead><tbody><tr><td><p><code>=</code></p></td><td><p>Boolean</p> <p>Date</p> <p>Numeric</p> <p>Text</p></td><td><p>Equal.</p></td></tr><tr><td><p><code>></code></p></td><td><p>Date</p> <p>Numeric</p></td><td><p>Greater than.</p></td></tr><tr><td><p><code>>=</code></p></td><td><p>Date</p> <p>Numeric</p></td><td>Greater than or equal to.</td></tr><tr><td><p><code><</code></p></td><td><p>Date</p> <p>Numeric</p></td><td><p>Less than.</p></td></tr><tr><td><p><code><=</code></p></td><td><p>Date</p> <p>Numeric</p></td><td><p>Less than or equal to.</p></td></tr><tr><td><p><code>!=</code></p></td><td><p>Boolean</p> <p>Date</p> <p>Numeric</p> <p>Text</p></td><td><p>Not equal.</p></td></tr><tr><td><p><code>contains</code></p></td><td><p>Text</p></td><td><p>The comparison value is a subset of the field value.</p> <p>Case insensitive.</p> <p>Example: Cat contains AT.</p></td></tr><tr><td><p><code>not contains</code></p></td><td><p>Text</p></td><td><p>The comparison value isn't a subset of the field value.</p> <p>Case insensitive.</p> <p>Example: Cat doesn’t contain dog.</p></td></tr><tr><td><p><code>endswith</code></p></td><td><p>Text</p></td><td><p>The comparison value is a subset of field value. The last character of the field value matches the last character of the comparison value.</p> <p>Case insensitive.</p> <p>Example: Cat ends with AT.</p></td></tr><tr><td><p><code>in</code></p></td><td><p>Instance</p> <p>Text</p></td><td><p>The field matches 1 or more possible values for a condition.</p></td></tr><tr><td><p><code>is empty</code></p></td><td><p>Boolean</p> <p>Date</p> <p>Instance</p> <p>Numeric</p> <p>Text</p></td><td><p>The field has no value.</p></td></tr><tr><td><p><code>is not empty</code></p></td><td><p>Boolean</p> <p>Date</p> <p>Instance</p> <p>Numeric</p> <p>Text</p></td><td><p>The field has a value.</p></td></tr><tr><td><p><code>not in</code></p></td><td><p>Instance</p> <p>Text</p></td><td><p>The field doesn't match any possible values for a condition.</p></td></tr><tr><td><p><code>startswith</code></p></td><td><p>Text</p></td><td><p>The comparison value is a subset of the field value. The first character of the field value matches the first character of the comparison value.</p> <p>Case insensitive.</p> <p>Example: Cat starts with CA.</p></td></tr></tbody></table><br/>

## <a id="section_ljd_lpr_35b"></a>Date and Time Formats

WQL supports dates and datetimes in Coordinated Universal Time (UTC) or Pacific Standard Time (PST).

<table><thead><tr><th>Date and Time</th><th>Format</th></tr></thead><tbody><tr><td>Date</td><td>YYYY-MM-DD</td></tr><tr><td>Time (24-hour clock)</td><td>HH:MM:SS</td></tr><tr><td>Datetime with time zone</td><td>PST: YYYY-MM-DD HH:MM:SS <p>UTC: YYYY-MM-DD HH:MM:SSZ</p></td></tr></tbody></table><br/>

## <a id="d261e536"></a>Examples

Return results from the <b>allWorkers</b> data source and <b>location</b> RBO by workers who:

-   Are over 50.
-   Work more than 23 hours.


```
SELECT worker, location{addresses}, age FROM allWorkers
  WHERE ON location addresses is NOT EMPTY
  WHERE defaultWeeklyHours > 23 AND age > 50
```

Return results from the <b>allWorkers</b> data source and <b>location</b> and <b>dependents</b> RBOs by workers whose:

-   Pay is a currency specified by a Workday ID.
-   Dependents' last names start with the letter N.
-   Age is over 50.
-   Location is in 2 specific cities.


```
SELECT worker, location{addresses}, dependents{legalName_LastName}, age FROM allWorkers
  WHERE ON location addresses is NOT EMPTY AND currency in (9e996ffdd3e14da0ba7275d5400bafd4)
  WHERE ON dependents legalName_LastName startswith "N"
  WHERE age > 50 OR location in (043e71ed793b1054de6213435945000c, d13a7c46a06443c4a33c09afbdf72c73)
```

## <a id="section_qpn_ywm_q5b"></a>Limitations

WHERE ON clauses must go before WHERE clauses.

