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
SELECT worker, employeeID, location
FROM allWorkers
WHERE location = 'San_Francisco_site'Fixed: using IN for Instance fields and = for primitive fields
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:
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 |
|---|---|---|
Operator= |
Compatible field typesBoolean, Date, Numeric, Text | Behavior and notesExact equality. Not valid for Instance fields. |
Operator!= |
Compatible field typesBoolean, Date, Numeric, Text | Behavior and notesInequality. Not valid for Instance fields. |
Operator>, >= |
Compatible field typesDate, Numeric | Behavior and notesGreater than / greater than or equal to. Preferred for lastFunctionallyUpdated delta cutoffs. |
Operator<, <= |
Compatible field typesDate, Numeric | Behavior and notesLess than / less than or equal to. Use with >= to bound a delta window. |
OperatorIN |
Compatible field typesInstance, Text | Behavior and notesMatches one or more WIDs, (inst_refId = referenceID) pairs, or text values. |
OperatorNOT IN |
Compatible field typesInstance, Text | Behavior and notesExcludes one or more WIDs, reference IDs, or text values. |
Operatoris empty |
Compatible field typesBoolean, Date, Instance, Numeric, Text | Behavior and notesMatches records where the field has no value. |
Operatoris not empty |
Compatible field typesBoolean, Date, Instance, Numeric, Text | Behavior and notesMatches records where the field is populated. |
Operatorcontains, not contains |
Compatible field typesText | Behavior and notesCase-insensitive substring match. |
Operatorstartswith, endswith |
Compatible field typesText | Behavior and notesCase-insensitive prefix or suffix match. |
WQL supports dates and datetimes in UTC or PST only:
| Value type | Required WQL literal format | Example |
|---|---|---|
| Value typeDate | Required WQL literal format'YYYY-MM-DD' |
Example'2026-12-01' |
| Value typeTime (24-hour clock) | Required WQL literal format'HH:MM:SS' |
Example'07:15:00' |
| Value typeDatetime (PST) | Required WQL literal format'YYYY-MM-DD HH:MM:SS' |
Example'2026-12-01 07:15:00' |
| Value typeDatetime (UTC) | Required WQL literal format'YYYY-MM-DD HH:MM:SSZ' |
Example'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
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
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):
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
SELECT worker, lastFunctionallyUpdated
FROM allWorkers
WHERE lastFunctionallyUpdated = '2026-12-01T00:00:00Z'Fixed: bounded UTC range with space-separated datetime literals
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:
- Call
GET {baseURL}/dataSources?alias={dataSourceAlias}to confirm the data source WID and whether it is indexed. - Call
GET {baseURL}/dataSources/{WorkdayID}/fieldsto verify thatlastFunctionallyUpdated(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:
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:
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.