Others

Select the First Non-Null Field in a Microsoft Access Query

Kushani NimanthikaKushani Nimanthika Nov 20, 2026 869 views

Question details

Return the first non-null value from fields A, B, and C in a Microsoft Access query.

Select the First Non-Null Field in a Microsoft Access Query
Product
Microsoft Access
Device & OS
not provided
Scenario
A query should check the fields in order and return A, then B, then C.
Observed behavior
Each query result should contain the first non-null value in the specified field order.
Before you start

Open the Access database and identify the table or query containing fields A, B, and C. Replace those field names in the expressions below if your database uses different names.

Solution 1Recommended

Use nested Nz functions in an Access query

Use this concise expression to return A if it is not null, otherwise B, and finally C.

1
Open the query in Design View

In the Navigation Pane, right-click your query and select Design View. To create a new query, select Create > Query Design and add the table containing the fields.

2
Enter the expression

In an empty Field cell in the design grid, enter: Result: Nz([A], Nz([B], [C])).

3
Run the query

Select Run to view the Result column. Each row returns A when available, otherwise B, or C if both A and B are null.

Use nested Nz functions in an Access query
Null and empty text are different: Nz checks for Null; it does not skip a zero-length text string or a zero value. If all three fields are Null, the expression returns Null.
Free Microsoft Office alternative

Work with exported Access data in WPS Spreadsheets

WPS Office is a free, lightweight alternative with a familiar interface. Export Access data to an Excel workbook, then open it in WPS Spreadsheets for review and editing. WPS does not run Access queries or replace the Access database engine.

Review and edit data exported from an Access queryCompatible with Microsoft Excel XLSX and XLS formatsFamiliar spreadsheet interface for an easy transitionFree and lightweight office suite
microsoft office alternative - wps office

Frequently Asked Questions

What happens if all three Access fields are null?

The expression Nz([A], Nz([B], [C])) returns Null when A, B, and C are all Null.

Can I use the Nz expression in SQL View?

Yes. In Access, open the query in SQL View and use an expression such as SELECT Nz([A], Nz([B], [C])) AS Result FROM [YourTable]; replacing YourTable with the actual table name.

Will Nz skip an empty string or zero?

No. Nz replaces Null values, but an empty string or zero is not Null. Use additional conditions if those values should also be skipped.

Can WPS Office run this Access query?

No. Run the query in Microsoft Access. You can export its results to an Excel workbook and open that workbook in WPS Spreadsheets.