Fix DMax and DMin Returning Null for Large Number Fields in Access 365
Question details
The user needs to retrieve maximum and minimum values from an Access Large Number field when DMax or DMin returns Null.

- Product
- Microsoft Access 365
- Device & OS
- not provided
- Scenario
- A database uses domain aggregate functions to find values in a Large Number field.
- Observed behavior
- DMax and DMin may return Null, while DSum and DCount may still work depending on the criteria and database configuration.
Identify the table or query, Large Number field, and criteria used in the DMax or DMin expression. Check whether the data is stored locally or in a linked table, because the Large Number setting for linked and imported tables may be relevant.
Retrieve the Maximum or Minimum with a Sorted DAO Recordset
Use a sorted recordset as a workaround if DMax or DMin still returns Null after you check the field and criteria.
The example excludes Null field values and returns Null if no matching non-Null row exists. Add the same filtering conditions used by your domain function to the SQL WHERE clause.
In Access, press Alt+F11, then select Insert > Module. Replace TableName and LargeNumberField in the example with your actual table and field names.
Add the following code inside a VBA procedure and use result where you need the maximum value: Dim rs As DAO.Recordset Dim result As Variant Set rs = CurrentDb.OpenRecordset("SELECT TOP 1 [LargeNumberField] FROM [TableName] WHERE [LargeNumberField] Is Not Null ORDER BY [LargeNumberField] DESC", dbOpenSnapshot) result = Null If Not rs.EOF Then result = rs.Fields(0).Value rs.Close Set rs = Nothing
Change ORDER BY [LargeNumberField] DESC to ORDER BY [LargeNumberField] ASC, then run the procedure again. Keep the result in a Variant so the code can also represent Null.
If the domain functions still return unexpected results, use Access Help > Feedback or contact Microsoft support. Provide the Access version, the expression, the field type, and a small test database that reproduces the behavior.

Check Large Number Support, Null Values, and Criteria
Use these checks to rule out configuration issues or an expression that matches no usable values.
Work with Office Files in WPS Office
WPS Office is a free, lightweight alternative with a familiar interface for working with documents, spreadsheets, and presentations. It supports common Microsoft Office formats for an easier transition, but it does not fix Access domain functions or replace an Access database.

Frequently Asked Questions
Why can DMax or DMin return Null?
Null can mean that no records match the criteria or that matching records have no non-Null values in the expression. If a select query confirms that matching Large Number values exist, use a sorted recordset as a workaround and report the behavior to Microsoft.
Where is the Large Number support setting in Access?
Open File > Options > Current Database and look for Support BigInt Data Type for Linked/Imported Tables. The setting applies to linked and imported tables and may not resolve a DMax or DMin issue.
How do I get the minimum instead of the maximum with a recordset?
In the SELECT TOP 1 query, change the field's ORDER BY direction from DESC to ASC. Keep any filters consistent with the original DMin criteria.
Does WPS Office fix DMax and DMin in Access?
No. DMax and DMin are Microsoft Access functions. WPS Office can work with common Office files such as XLSX spreadsheets, but it does not repair or replace an Access database.




