DBMin Function

The DBMin function returns the smallest value from a column in a table. The rows that are compared can be limited by applying a filter

This function can be added to your worksheet by using the Function Wizard.


DBMin( connection , table , column , filter , [ parameter1 ] , [ ...parameter n ])

The DBMin function syntax has these parts:

connectionRequired. This argument identifies the connection name used to connect to the database.
tableRequired. This argument identifies an SQL statement or a specific internal table name in the database. If this argument does not supply a valid source of data, then the result of the function will be #TABLE? ("table name" not found).
columnRequired. This argument identifies an internal field name or alias returned by the table name argument. If this argument does not contain a valid field name, then the result of the function will be #FIELD? ("field name" not found).
filterOptional. A filter is a string of text that includes comparisons between fields in the table and specific values as a literal value or a parameter. Parameters to a cell reference are indicated by using a question mark placeholder within the filter string. The function will evaluate the question mark placeholder with the corresponding parameter. Only the records that satisfy the filter conditions will be used to return values.
parameter 1 , [ ...parameter n ]Required if filter uses placeholders. This is a comma-delimited list of values or cell references used to replace the corresponding question mark placeholders within the filter string. Parameter 1 is used for the first question mark placeholder in the filter, Parameter 2 would represent the second question mark placeholder, and so on.

DBMin Example

Returns the first due date for the invoices for the vendor specified in cell A5.

=DBMax("Sage 100 Contractor", "acpinv", "duedte", "vndnum=?", $A5)