---
title: "Workday WQL WHERE: =, OR, and lastFunctionallyUpdated"
description: "Filter lastFunctionallyUpdated with OR and = in Workday WQL. Verified date formats, parentheses rules, Instance IN syntax, and working delta query examples."
url: https://kiweely.com/guides/workday-wql-lastfunctionallyupdated-or-filter-syntax
---

# Workday WQL WHERE Syntax: = Equality, OR Logic, and lastFunctionallyUpdated

In Workday Query Language (WQL), use = only on Boolean, Date, Numeric, and Text fields (use IN for Instance fields), quote datetimes as ‘YYYY-MM-DD HH:MM:SSZ’ (UTC) or ‘YYYY-MM-DD HH:MM:SS’ (PST), and wrap every OR group in parentheses when combining with lastFunctionallyUpdated.

-   **Checked** against Workday on December 4
-   Applies to **Workday Extend**
-   6 min read
-   Published December 4
-   By Kiweely

In Workday Query Language (WQL), `=` works only on Boolean, Date, Numeric, and Text fields (Instance fields require `IN`), and any `OR` condition combined with `lastFunctionallyUpdated` must be wrapped in parentheses `()` so Workday evaluates the group first. Date and timestamp literals in WQL `WHERE` clauses must use `'YYYY-MM-DD'`, `'YYYY-MM-DD HH:MM:SS'` (PST), or `'YYYY-MM-DD HH:MM:SSZ'` (UTC), with a space rather than an ISO `T` separator.

## How `=` equality works in WQL `WHERE` clauses

WQL does not treat every field the same way when you test for equality. The `=` and `!=` operators are valid only on four primitive field types: **Boolean**, **Date**, **Numeric**, and **Text**.

If the field is an **Instance** field (such as `worker`, `location`, or `company`), `=` is not supported. You must use `IN` with either a 32-character Workday ID (WID) or a reference ID expression in the form `(Reference_ID_Type = Reference_ID)`. Workday validates the WID format at runtime and fails the query when the format is invalid. Reference IDs inside `IN` accept values with or without double quotes: `(Location_ID = San_Francisco_site)` and `(Location_ID = "San_Francisco_site")` are both valid.

**Broken: using `=` on an Instance field**

sql

```
SELECT worker, employeeID, location
FROM allWorkers
WHERE location = 'San_Francisco_site'
```

**Fixed: using `IN` for Instance fields and `=` for primitive fields**

sql

```
SELECT worker, employeeID, location
FROM allWorkers
WHERE location IN (Location_ID = "San_Francisco_site")
  AND employeeID = '21001'
```

When you filter an Instance field by Workday ID instead of a reference ID, pass the bare WID inside parentheses:

sql

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

## WQL `WHERE` operators and date/timestamp literal reference

Workday’s WQL Reference documents the exact data types each `WHERE` operator accepts and the three date/time literal formats WQL parses.

| Operator | Compatible field types | Behavior and notes |
| --- | --- | --- |
| `=` | Boolean, Date, Numeric, Text | Exact equality. Not valid for Instance fields. |
| `!=` | Boolean, Date, Numeric, Text | Inequality. Not valid for Instance fields. |
| `>`, `>=` | Date, Numeric | Greater than / greater than or equal to. Preferred for `lastFunctionallyUpdated` delta cutoffs. |
| `<`, `<=` | Date, Numeric | Less than / less than or equal to. Use with `>=` to bound a delta window. |
| `IN` | Instance, Text | Matches one or more WIDs, `(inst_refId = referenceID)` pairs, or text values. |
| `NOT IN` | Instance, Text | Excludes one or more WIDs, reference IDs, or text values. |
| `is empty` | Boolean, Date, Instance, Numeric, Text | Matches records where the field has no value. |
| `is not empty` | Boolean, Date, Instance, Numeric, Text | Matches records where the field is populated. |
| `contains`, `not contains` | Text | Case-insensitive substring match. |
| `startswith`, `endswith` | Text | Case-insensitive prefix or suffix match. |

WQL supports dates and datetimes in **UTC** or **PST** only:

| Value type | Required WQL literal format | Example |
| --- | --- | --- |
| Date | `'YYYY-MM-DD'` | `'2026-12-01'` |
| Time (24-hour clock) | `'HH:MM:SS'` | `'07:15:00'` |
| Datetime (PST) | `'YYYY-MM-DD HH:MM:SS'` | `'2026-12-01 07:15:00'` |
| Datetime (UTC) | `'YYYY-MM-DD HH:MM:SSZ'` | `'2026-12-01 07:15:00Z'` |

## Why `OR` with `lastFunctionallyUpdated` fails or returns wrong rows

Delta queries that combine `OR` with `lastFunctionallyUpdated` usually break for one of four reasons.

### 1\. Missing parentheses around `OR` conditions

Workday evaluates expressions inside parentheses `()` first. When you mix `AND` and `OR` in a `WHERE` clause without explicit parentheses, the `OR` branch can bypass your scope filter or bypass your `lastFunctionallyUpdated` window altogether.

**Broken: ungrouped `OR` bypasses the `lastFunctionallyUpdated` cutoff**

sql

```
SELECT worker, employeeID, lastFunctionallyUpdated
FROM allWorkers
WHERE location IN (Location_ID = "San_Francisco_site")
   OR location IN (Location_ID = "New_York_site")
  AND lastFunctionallyUpdated >= '2026-12-01 00:00:00Z'
```

Without parentheses around the two `location` checks, `AND` binds tighter than `OR`. Every worker in San Francisco comes back regardless of `lastFunctionallyUpdated`, while only New York workers are filtered by the timestamp.

**Fixed: wrap the `OR` branch (or collapse it into a single `IN` list) and group the timestamp check**

sql

```
SELECT worker, employeeID, lastFunctionallyUpdated
FROM allWorkers
WHERE (
    location IN (Location_ID = "San_Francisco_site")
    OR location IN (Location_ID = "New_York_site")
  )
  AND lastFunctionallyUpdated >= '2026-12-01 00:00:00Z'
```

The same rule applies in reverse when `lastFunctionallyUpdated` is inside the `OR` group (for example, catching records modified since the last run or records whose update timestamp is empty):

sql

```
SELECT worker, employeeID, lastFunctionallyUpdated
FROM allWorkers
WHERE location IN (Location_ID = "San_Francisco_site")
  AND (
    lastFunctionallyUpdated >= '2026-12-01 00:00:00Z'
    OR lastFunctionallyUpdated is empty
  )
```

### 2\. Invalid datetime format or using `=` on a timestamp

Passing an ISO-8601 string with a `T` separator (`'2026-12-01T00:00:00Z'`), fractional seconds, or a numeric offset (`'-08:00'`) does not match WQL’s documented datetime formats (`'YYYY-MM-DD HH:MM:SS'` for PST or `'YYYY-MM-DD HH:MM:SSZ'` for UTC). Even with a valid format, `lastFunctionallyUpdated = '2026-12-01 00:00:00Z'` matches only that exact second.

**Broken: ISO `T` separator and exact `=` on a timestamp**

sql

```
SELECT worker, lastFunctionallyUpdated
FROM allWorkers
WHERE lastFunctionallyUpdated = '2026-12-01T00:00:00Z'
```

**Fixed: bounded UTC range with space-separated datetime literals**

sql

```
SELECT worker, lastFunctionallyUpdated
FROM allWorkers
WHERE (
  lastFunctionallyUpdated >= '2026-12-01 00:00:00Z'
  AND lastFunctionallyUpdated <= '2026-12-04 00:00:00Z'
)
```

### 3\. Trying to `OR` a Related Business Object field inside `WHERE`

A `WHERE` clause only filters fields on the primary business object of the `FROM` data source. Related Business Object (RBO) fields are filtered with `WHERE ON`, not `WHERE`. In Workday WQL, every `WHERE ON` clause must appear before the `WHERE` clause, and you omit the curly braces `{}` used in `SELECT`.

Because `WHERE ON` filters the related object separately from `WHERE`, you cannot write a single `WHERE primary.lastFunctionallyUpdated >= ... OR rbo.lastFunctionallyUpdated >= ...` expression across objects. If your delta logic depends on changes to both the primary object and a child RBO, either query a data source whose primary business object is the child object, or run two separate WQL queries and union the returned WIDs in your integration.

### 4\. Field alias or indexed data source constraints

`lastFunctionallyUpdated` is not guaranteed to exist under that exact alias on every data source. Before writing a delta filter, verify the data source alias, its indexing flag, and the exact field alias using the WQL REST API:

1.  Call `GET {baseURL}/dataSources?alias={dataSourceAlias}` to confirm the data source WID and whether it is indexed.
2.  Call `GET {baseURL}/dataSources/{WorkdayID}/fields` to verify that `lastFunctionallyUpdated` (or the target timestamp alias) is exposed on that primary business object and accessible to your API user.

You can also inspect aliases inside Workday by running a custom report on the **Data Sources** or **Fields** report data source with the **WQL Alias** field.

Keep one indexed-data-source limitation in mind when building delta queries: `FROM` temporal prompts (`effectiveAsOfDate`, `effectiveAsOfMoment`, `entryDate`, and `entryMoment`) are supported only on Standard Workday-delivered data sources. Indexed data sources do not accept those `FROM` parameters and reflect background index refreshes rather than instantaneous transaction commits, so leave a small overlap window in your `lastFunctionallyUpdated >=` watermark and deduplicate by WID downstream.

## Working WQL examples for incremental delta queries

### Bounded UTC delta with multiple `OR` business conditions

This pattern pulls records updated inside a closed UTC window when either of two business conditions holds. Every `OR` group and range check is parenthesized explicitly:

sql

```
SELECT worker, employeeID, workerStatus, lastFunctionallyUpdated
FROM allWorkers
WHERE (
    lastFunctionallyUpdated >= '2026-12-03 00:00:00Z'
    AND lastFunctionallyUpdated < '2026-12-04 00:00:00Z'
  )
  AND (
    location IN (Location_ID = "San_Francisco_site")
    OR workerStatus = 'Active'
  )
```

### Combining `WHERE ON` (RBO filter) with a `lastFunctionallyUpdated` `WHERE` clause

When you also filter a Related Business Object, place `WHERE ON` before `WHERE` and keep the braces `{}` only in `SELECT`:

sql

```
SELECT worker, location{addresses}, lastFunctionallyUpdated
FROM allWorkers
WHERE ON location addresses is not empty
WHERE (
    lastFunctionallyUpdated >= '2026-12-03 00:00:00Z'
    OR lastFunctionallyUpdated is empty
  )
  AND location IN (Location_ID = "San_Francisco_site")
```

### Clearing cached delta results on `GET /data`

Workday caches WQL query results for 30 minutes. If an incremental integration re-runs the same `GET /data` query within that window to re-check recent updates, include `offset=0` on the request URL (`{baseURL}/data?offset=0&query=...`) so Workday clears the cached result set. For queries longer than 2,048 characters (up to 16,000 characters), send the query in the JSON body of `POST {baseURL}/data`.

## Sources checked

-   [Workday Administrator Guide: WQL Reference: WHERE](https://doc.workday.com/admin-guide/en-us/reporting-and-analytics/custom-reports-and-analytics/workday-query-language-wql-/wql-reference/fsf1611267464081.html)
-   [Workday Administrator Guide: WQL Reference: FROM](https://doc.workday.com/admin-guide/en-us/reporting-and-analytics/custom-reports-and-analytics/workday-query-language-wql-/wql-reference/kba1611189724822.html)
-   [Workday Administrator Guide: WQL Reference: WHERE ON](https://doc.workday.com/admin-guide/en-us/reporting-and-analytics/custom-reports-and-analytics/workday-query-language-wql-/wql-reference/czb1657128437777.html)
-   [Workday Developers: Reference: WQL Aliases](https://developer.workday.com/doc/ktw1644956621314.md)
-   [Workday Developers: Reference: WQL REST API](https://developer.workday.com/doc/GUID-5c940864-7651-4e28-a9d2-79b45292e66a-enHYPHENus.md)

## Related guides

[All guides](https://kiweely.com/guides)

### More guides on WQL

[All 44 guides](https://kiweely.com/guides#wql)

-   [Workday WQL Alias Naming Rules and Restrictions](https://kiweely.com/guides/workday-wql-alias-naming-rules-and-restrictions)
-   [Fix Workday WQL ExternalFieldException: Convert Currency Field Did Not Find a Currency Conversion Rate](https://kiweely.com/guides/workday-wql-convert-currency-external-field-exception)
-   [Does Workday WQL Support SELECT \*? How to List Data Source Fields](https://kiweely.com/guides/workday-wql-select-star-wildcard)
-   [Workday to Snowflake and Databricks: Comparing Data Cloud, Prism Analytics, WQL, and RaaS Extracts](https://kiweely.com/guides/workday-to-snowflake-databricks-data-cloud-prism-wql)
-   [Workday with MuleSoft, Boomi, and Workato: Choosing SOAP, REST, WQL, or RaaS and Governing Limits](https://kiweely.com/guides/workday-with-mulesoft-boomi-workato-integration-architecture)
-   [Workday 2027R1 Changes for Extend, Orchestrate, Studio, and APIs: Breaking Changes and Regression Checks](https://kiweely.com/guides/workday-2027r1-extend-orchestrate-studio-apis-breaking)
-   [Running WQL Queries in a Personal Workday Developer Tenant (Ready-to-Run GMS Examples)](https://kiweely.com/guides/workday-wql-queries-personal-developer-tenant-gms-examples)
-   [Calling Workday REST, Graph, and WQL APIs From a Personal Developer Tenant](https://kiweely.com/guides/workday-personal-developer-tenant-rest-graph-wql-apis)

### From the blog on WQL

[All posts](https://kiweely.com/blog)

-   [What happens after ChatGPT writes your WQL query](https://kiweely.com/blog/after-chatgpt-writes-your-wql)
-   [Workday 2027R1: The Five Changes Most Likely to Break Existing Reports, Security, and Integrations](https://kiweely.com/blog/workday-2027r1-five-changes-break-reports-security-apis)
-   [Workday 2027R1 for Extend and Orchestrate Teams: What to Retest Before Production Cutover](https://kiweely.com/blog/workday-2027r1-extend-orchestrate-what-to-retest)

## Run WQL against your real tenant.

Kiweely Vine inspects your tenant's data sources and fields, runs the query under your Workday security, and verifies the rows returned.

[Get in touch](https://kiweely.com/vine#partners) [See Vine at work](https://kiweely.com/vine/work)

## Get the next guide in your inbox.

One email a month with new guides and one Extend tip. Nothing else.
