Convert a SQL Server FULL OUTER JOIN to Microsoft Access
Question details
Convert a SQL Server query with a FULL OUTER JOIN into a query that runs in Microsoft Access.

- Product
- Microsoft Access and Microsoft SQL Server
- Device & OS
- not provided
- Scenario
- A SQL Server query needs to be adapted for use in an Access database.
- Observed behavior
- Access does not support a native FULL OUTER JOIN or SQL Server CTE syntax, and the source query may contain undefined aliases or other errors.
Check the source query, table names, join keys, and selected columns in SQL Server first. Identify a non-nullable key on the first table to use when filtering unmatched rows in Access.
Replace the FULL OUTER JOIN with two LEFT JOIN queries
Use this approach to return matching rows and unmatched rows from both tables in Access.
The first LEFT JOIN returns all rows from TableA and any matches from TableB. The second returns only TableB rows without a match in TableA. UNION ALL combines the results without removing duplicate rows.
The example assumes TableA.ID is non-nullable. Replace the table names, fields, and join condition with those from your query, keeping the selected columns in the same order in both SELECT statements.
Run the original query in SQL Server Management Studio. Define any CTEs, correct undefined aliases, qualify ambiguous fields such as rn with the appropriate alias, and confirm that each selected column exists.
In Access, select Create > Query Design, switch to SQL View, and save separate queries for any SQL Server CTEs or other intermediate results that Access cannot express in the same way. Adapt unsupported SQL Server syntax as needed.
Create another query in SQL View and enter: SELECT a.ID, a.ValueA, b.ID, b.ValueB FROM TableA AS a LEFT JOIN TableB AS b ON a.ID = b.ID UNION ALL SELECT a.ID, a.ValueA, b.ID, b.ValueB FROM TableB AS b LEFT JOIN TableA AS a ON b.ID = a.ID WHERE a.ID IS NULL;
Select Run in Query Design and compare the results with the intended SQL Server output. Check matched rows, rows unique to each table, and duplicate join keys.

Work with exported query results in WPS Office
WPS Office is a free, lightweight alternative for working with Office documents and spreadsheets in a familiar interface. Export Access query results to a spreadsheet to review them in WPS; WPS does not convert or run the Access query itself.

Frequently Asked Questions
Does Microsoft Access support FULL OUTER JOIN?
No. In Access SQL View, combine a LEFT JOIN in each direction with UNION ALL, filtering the second SELECT to include only rows without a match in the first table.
Why use UNION ALL instead of UNION?
UNION ALL preserves duplicate rows, while UNION removes duplicates. Preserving duplicates generally matches FULL OUTER JOIN behavior when multiple rows share a join key.
How can I replace a SQL Server CTE in Access?
Create and save an intermediate query using Create > Query Design > SQL View, then reference that saved query by name in the final Access query. Adjust any SQL Server-specific syntax in the intermediate query.
What should I do if an alias or rn is undefined?
Check the original query in SQL Server Management Studio. Define the missing table or CTE alias, qualify rn with the alias of the source that provides it, and verify that the field is selected by that source.
Why must the two SELECT lists match?
Access combines UNION ALL results by column position. Select the same number of fields in the same order, with compatible data types, in both branches so values appear in the intended columns.




