---
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
layout: subsection
---

<a id="d490e386"></a>
Specifies one or more conditional expressions that filter the results of the query. 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="d490e398"></a>Syntax

```
WHERE 
  field1 = value1  
  AND field2 IN (instance1, instance2) 
  OR field3 IN (inst_refId = referenceID)
```

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

<table><thead><tr><th><p>Argument</p></th><th><p>Description</p></th></tr></thead><tbody><tr><td><p><code><i>field1</i>, <i>field2</i>, ...<i>fieldN</i></code></p></td><td><p>The alias for a field in the conditional expression.</p></td></tr><tr><td><p><code><i>value1</i>, <i>value2</i>, ...<i>valueN</i></code></p></td><td><p>The value of the field 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 ID of the field value you want to match.</p> <p>When you run a query, Workday validates the format of the Workday ID and fails the query when the format is invalid.</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_x3t_dvr_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_qql_kvr_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="d490e597"></a>Examples

Return worker and location fields from the <b>allWorkers</b> data source where the location is San Francisco and the Workday ID is a specific worker:

```
SELECT worker, location  
FROM allWorkers
WHERE location in (Location_ID = San_Francisco_site) AND worker in (3895af7993ff4c509cbea2e1817172e0) 
```

Return billable transactions that were approved between 7:15 AM on August 1, 2020 and 7:45 AM on August 30, 2020, using Coordinated Universal Time (UTC) by adding Z to the datetime values:

```
SELECT billableProject, projectCompany, approvalDate 
FROM billableProjectTransactions 
WHERE (approvalDate >= '2020-08-01 07:15:00Z' AND approvalDate <= '2020-08-30 07:45:00Z')
```

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

WHERE ON clauses must go before WHERE clauses.

### Related Information

[Concept: Related Business Objects in WQL](/wcp_docs/GUID-5295e235-6d69-4b80-ad51-510afbdfb853-enHYPHENus.html)

[SELECT](/wcp_docs/GUID-85db8d16-4698-4dea-bef2-23223739c8e6-enHYPHENus.html)

[2022R2 What's New Post: Workday Query Language (WQL)](https://community.workday.com/node/987765)

