How to Show Zero Values in an Access Query or Report
Question details
The user needs to display groups with a count of zero or missing records in an Access query or report.

- Product
- Microsoft Access
- Device & OS
- not provided
- Scenario
- Generating a report or running an aggregate query where certain categories, business units, or learner types have no data but still need to be displayed with a '0' rather than being excluded entirely.
- Observed behavior
- Groups with a zero count are completely omitted from the query results or report because they are filtered out by WHERE/HAVING criteria or missing related rows.
Ensure you have a master table or query that contains all the categories or groups you want to display, regardless of whether they have matching transaction data in your primary table.
Use a LEFT JOIN and the Nz() Function
The most reliable way to show all groups, even those with zero records, is to establish a LEFT JOIN from a master table and convert nulls to zeros.
By default, Access uses an INNER JOIN, which only shows records that exist in both tables. A LEFT JOIN ensures all records from the primary (left) table are displayed.
When a record from the left table has no matching data in the right table, Access returns a Null value. The Nz() function can intercept this Null and display a '0' instead.
Open your Access database, navigate to the 'Create' tab on the ribbon, and click 'Query Design'.
Add both your master table (which contains all groups) and your transaction/data table to the query grid.
Double-click the join line connecting the two tables. Select the option that says 'Include ALL records from [MasterTable] and only those records from [TransactionTable] where the joined fields are equal'.
In a new column of the query design grid, type an expression using the Nz function to handle the count. For example: `TotalCount: Nz(Count([TransactionTable].[ID]), 0)`.
Click the 'Run' button on the ribbon. You should now see all groups listed, with '0' appearing for those that lack transaction records.

Troubleshoot WHERE and HAVING Clauses
If records are still unexpectedly missing, your WHERE or HAVING clauses might be filtering out the null or zero-value groups.
Analyze Your Database Exports with WPS Office
While WPS Office does not include a direct database replacement for Microsoft Access, it offers a highly compatible, lightweight, and free alternative to Microsoft Excel, Word, and PowerPoint. You can easily export your Access query results and use WPS Spreadsheet's powerful PivotTables to analyze your data—including natively showing items with no data.
- 1. Export Access Query: Right-click your Access query, select 'Export', and choose 'Excel' or 'Text File' to save your data.
- 2. Open in WPS Spreadsheet: Launch WPS Office and open the exported file to quickly view and format your dataset.
- 3. Analyze with PivotTables: Select your data, insert a PivotTable, right-click the field settings, and check 'Show items with no data' to handle missing groups effortlessly.

Frequently Asked Questions
Why do null values disappear in Access queries?
Null values often disappear because WHERE or HAVING clauses filter them out. If a condition requires a specific value (e.g., Status = 'Active'), records with a Null (blank) in that field will fail the condition and be excluded from the results.
What is the difference between a zero and a Null in Access?
In Microsoft Access, a zero is an actual numeric value indicating a count or amount of 0. A Null, on the other hand, indicates that data is missing, unknown, or does not exist. They are treated entirely differently by the database engine.
How does the Nz() function work?
The Nz() function evaluates a field and returns a specified value (like 0) if the field is found to be Null. For example, using `Nz([SalesAmount], 0)` will display the number 0 instead of leaving a blank space if there are no sales records.
Can I show items with no data in Access Reports natively?
Reports rely entirely on the data fed to them by the underlying table or query. To show items with no data in a report, you must first fix the underlying query using the LEFT JOIN and Nz() methods so that the report receives the zero values.




