Workday Query Language (WQL) copies SQL’s declarative clause order (SELECT, FROM, WHERE, GROUP BY, HAVING, ORDER BY, LIMIT), so anyone who writes SQL can read a WQL query immediately. Underneath that surface, WQL is a read-only query layer over Workday’s object-graph reporting engine, not a relational database engine: it has no JOIN, UNION, CASE, subqueries, SELECT *, or write statements (INSERT, UPDATE, DELETE).
How WQL Logic Differs from Relational SQL
In standard SQL, the query planner executes set-based relational algebra across normalized tables using arbitrary join keys. In Workday WQL, every query targets a single Workday data source (or a table-backed Prism data source prefixed with cds_), which is bound to one Primary Business Object (PBO) and its pre-defined Related Business Objects (RBOs).
Execution is also governed by Workday’s security model and reporting limits rather than database-level table grants:
- Every field and data source is filtered at runtime by the calling user’s or Integration System User’s Workday security domains.
- A single WQL query cannot return more than 1 million rows; queries exceeding that ceiling fail unless narrowed.
- Query execution times out after 30 minutes on tenanted hosts and 5 minutes through the Workday Cloud Platform API gateway (
api.workday.com).
Side-by-Side Comparison: WQL vs Standard SQL
| Capability | Standard SQL | Workday WQL |
|---|---|---|
| CapabilityWildcard columns | Standard SQLSELECT * |
Workday WQLNot supported; every field alias must be named explicitly |
| CapabilityColumn aliasing | Standard SQLfield AS alias |
Workday WQLfield AS alias (required to disambiguate multiple fields from the same RBO) |
| CapabilityData target | Standard SQLTable or view (FROM workers) |
Workday WQLWorkday data source with optional filter and prompts (FROM workersForHCMReporting(dataSourceFilter = allActiveWorkers)) |
| CapabilityJoining related data | Standard SQLINNER JOIN / LEFT JOIN on arbitrary keys |
Workday WQLPre-wired RBO traversal with curly braces in SELECT (location{locationName}) and WHERE ON for filtering |
| CapabilityEquality and inequality | Standard SQL=, !=, <> |
Workday WQL=, !=, <> |
| CapabilityNull checks | Standard SQLIS NULL, IS NOT NULL |
Workday WQLis empty, is not empty |
| CapabilityPattern matching | Standard SQLLIKE '%text%' |
Workday WQLCase-insensitive contains, not contains, startswith, endswith |
| CapabilitySet membership | Standard SQLIN ('a', 'b') |
Workday WQLIN ('wid1', 'wid2') or IN (inst_refId = "USA") for instances |
| CapabilityDistinct values | Standard SQLSELECT DISTINCT col |
Workday WQLOnly inside COUNT(DISTINCT field) |
| CapabilityConditional logic | Standard SQLCASE WHEN ... THEN ... END |
Workday WQLNot supported in WQL (build a Workday calculated field instead) |
| CapabilitySet operations and nesting | Standard SQLUNION, INTERSECT, subqueries, CTEs |
Workday WQLNot supported |
| CapabilityPagination | Standard SQLLIMIT and OFFSET clauses |
Workday WQLLIMIT in query (1 to 999,999); REST API URL parameters limit (max 10,000 per page) and offset |
| CapabilityData modification (DML/DDL) | Standard SQLINSERT, UPDATE, DELETE, CREATE |
Workday WQLRead-only; mutations require Workday REST or SOAP APIs |
WQL WHERE Equality and Filter Syntax
WQL’s WHERE clause evaluates Boolean expressions using AND, OR, and parentheses ( ) to control precedence (parenthesized expressions evaluate first). Literal formatting depends on the field’s Workday data type:
- Text fields: wrap string literals in single quotes (
WHERE status != 'Terminated'). - Boolean and numeric fields: leave literals unquoted (
WHERE isActive = true,WHERE yearsOfService >= 5). - Date fields: convert string dates with
TO_DATE(WHERE accounting_Date <= TO_DATE('2026-01-01', 'yyyy-MM-dd')). - Empty checks: use
is emptyoris not emptyinstead ofIS NULL(WHERE terminationDate is empty). Both operators work across Boolean, Date, Instance, Numeric, and Text fields. - Substring checks: use
contains,not contains,startswith, orendswithinstead ofLIKE. All four are case-insensitive (WHERE businessTitle contains 'Manager',WHERE businessTitle endswith 'Lead'). - Workday IDs (WIDs) and Reference IDs: use
IN (...)to match instance fields against 32-character hexadecimal WIDs or reference IDs (inst_refId = "referenceID", where the double quotes around the reference ID are optional).
Example 1: Equality, Boolean, and Text Filters
SELECT employeeID, legalName_lastName, businessTitle, hireDate
FROM allWorkers
WHERE isActive = true
AND (businessTitle contains 'Engineer' OR businessTitle contains 'Architect')
AND terminationDate is empty
ORDER BY hireDate DESCExample 2: Filtering by WID or Reference ID (IN)
SELECT worker, employeeID, location
FROM allWorkers
WHERE locationCountry IN (inst_refId = "USA")
AND location IN ('0c0bbf2e124810a26765415bb08406c5', '4a9f10c3b81210a26765415bb08407d1')Each WID inside IN (...) must be an individual item. Passing a comma-separated string inside a single pair of quotes (IN ('wid1,wid2')) fails with HTTP 400 Bad Request (Specify a valid value for the field).
Traversing Related Business Objects Instead of JOIN
WQL replaces SQL JOIN statements with Related Business Object (RBO) traversal. In the SELECT clause, reference fields on a related object by placing the related field inside curly braces {} after the RBO link field, and add a unique AS alias when selecting multiple fields from the same RBO.
To filter rows based on an RBO field (including multi-instance fields such as dependents), place a WHERE ON clause immediately after FROM and before any primary WHERE clause. Omit the curly braces inside WHERE ON.
Example 3: Selecting and Filtering a Related Business Object
SELECT
worker,
dependents{legalName_FirstName} AS dependentFirstName,
dependents{age} AS dependentAge
FROM allWorkers
WHERE ON dependents age < 18
WHERE isActive = trueWhen sending a WQL query in a GET request query string, REST clients that do not automatically encode URLs require { and } to be percent-encoded as %7B and %7D.
Data Source Filters and Prompt Parameters (FROM and PARAMETERS)
Unlike SQL tables, many Workday data sources expose built-in data source filters and prompt parameters that restrict records before the WHERE clause runs. You can pass prompt values either inside the FROM clause parentheses or in a leading PARAMETERS clause, but never in both places in the same query, and each parameter may appear only once.
Example 4: Data Source Filter with Inline Prompt Parameters
SELECT worker, businessTitle, employeeID, hireDate
FROM workersForHCMReporting(
dataSourceFilter = allActiveWorkers,
location = ("0c0bbf2e124810a26765415bb08406c5")
)
ORDER BY employeeID ASCThe same query can move the prompt into a PARAMETERS block while keeping dataSourceFilter inside FROM:
PARAMETERS location = ("0c0bbf2e124810a26765415bb08406c5")
SELECT worker, businessTitle, employeeID, hireDate
FROM workersForHCMReporting(dataSourceFilter = allActiveWorkers)
ORDER BY employeeID ASCAggregation, GROUP BY, HAVING, and Pagination
WQL supports AVG(), COUNT(), COUNT(DISTINCT field), MAX(), MIN(), and SUM() in SELECT and HAVING. Percentile functions are not supported.
GROUP BYrestrictions: WQL cannot group by aggregated fields, currency fields, or multi-instance fields.HAVING: requires aGROUP BYclause and filters aggregated groups (for example,HAVING count() > 100).LIMITvs RESTlimitandoffset: An in-queryLIMITclause accepts an integer from1to999,999, but Workday still evaluates the full result set before truncating it, soLIMITdoes not improve backend execution speed. To page through large datasets via/wql/v1/data, use the REST query parameterslimit(up to10,000rows per page) andoffset(0-based starting row). For a full walkthrough of large result pagination, see How to return more than 500 rows in WQL.
For quick syntax lookup across clauses, keep the Workday WQL Cheat Sheet handy.
Common Errors SQL Developers Hit in WQL
- Writing
SELECT *: WQL rejects wildcard projections. Every column must use its exact Workday WQL field alias; if you do not know an alias, build a quick Custom Report and run the Workday task Convert Report to WQL. - Using
IS NULLorLIKE: ReplaceIS NULL/IS NOT NULLwithis empty/is not empty, and replaceLIKEwithcontains,not contains,startswith, orendswith. - Filtering an RBO in the main
WHEREclause: WritingWHERE dependents{age} < 18orWHERE dependents is not emptyfails validation (such ascan only be used as a related business object field (RBO)). Move RBO filters intoWHERE ON <rboAlias> <field> .... - Duplicating prompt parameters across
PARAMETERSandFROM: Supply data source filter prompts in one location only, or the query fails validation. - Assuming
LIMIT 10speeds up a slow query: Because WQL computes the full result set before applyingLIMIT, always narrow the dataset with an indexeddataSourceFilteror selectiveWHEREconditions first. - Expecting
CASEor subqueries to reshape data: WQL does not evaluate conditional branching or nested queries. Create a Workday calculated field for conditional logic and query that field’s WQL alias, or perform joins and transformations downstream.
Sources checked
- Workday Documentation: Concept: Workday Query Language (WQL)
- Workday Documentation: WQL SELECT Clause Reference
- Workday Documentation: WQL FROM Clause Reference
- Workday Documentation: WQL WHERE Clause Reference
- Workday Documentation: WQL WHERE ON Clause Reference
- Workday Documentation: WQL PARAMETERS Clause Reference
- Workday Documentation: WQL LIMIT and Result Limits Reference