DMin and DMax Functions MS Access
Last Updated :
15 Sep, 2020
1.DMin() Function :
DMin() Function in MS Access is used to determine the minimum values in a specified set of records (a domain). The DMin functions return the minimum values that satisfy the criteria. If expression identifies numeric data, the DMin functions return numeric values. If expression identifies string data, they return the string that is first alphabetically. The difference between DMin and Min is that in DMin function, values are evaluated before the data is grouped and in the case of Min function, the data is grouped before values in the field expression are evaluated.
Syntax : DMin ( expr , domain , criteria)
Parameters :
This method accepts three-parameter as mentioned above and described below :
- expr - It identifies the field for which we want to find the minimum value. It can be a string expression identifying a field in a table or query, or it can be an expression that performs a calculation on data in that field.
- domain - It identifies the set of records that constitutes the domain. It can be a table name or a query name for a query that does not require a parameter.
- criteria - It identifies a string expression used to restrict the range of data on which the DMin function is performed. It is optional. It is the WHERE clause to apply to the domain.
Returns :
It returns minimum values in a specified set of records.
Table -ProcuctDetails.
Product_Id | Product_Price |
---|
101 | 10000 |
102 | 11000 |
103 | 5000 |
104 | 7000 |
Example-1 :
Finding the minimum product price
Select DMin("Product_Price", "ProcuctDetails") as Min_Price;
Output :
Example-2 :
Finding the minimum product price for a given condition where the product id is 104.
Select DMin("Product_Price", "ProcuctDetails","Product_Id = 104") as Min_Price;
Output :
2.DMax() Function -
DMax() Function in MS Access is used to determine the maximum values in a specified set of records (a domain). The DMax functions return the maximum values that satisfy the criteria. If expr identifies numeric data, the DMax functions return numeric values. If expr identifies string data, they return the string that is last alphabetically. The difference between DMax and Max is that in DMax function, values are evaluated before the data is grouped and in the case of Max function, the data is grouped before values in the field expression are evaluated.
Syntax -
DMax( expr , domain , criteria)
Parameters :
This method accepts three-parameter as mentioned above and described below :
- expr - It identifies the field for which we want to find the maximum value. It can be a string expression identifying a field in a table or query, or it can be an expression that performs a calculation on data in that field.
- domain - It identifies the set of records that constitutes the domain. It can be a table name or a query name for a query that does not require a parameter.
- criteria - It identifies a string expression used to restrict the range of data on which the DMax function is performed. It is optional. It is the WHERE clause to apply to the domain.
Returns :
It returns maximum values in a specified set of records.
Table -ProcuctDetails.
Product_Id | Product_Price |
---|
101 | 10000 |
102 | 11000 |
103 | 5000 |
104 | 7000 |
Example-1 :
Finding the maximum product price.
Select DMax("Product_Price", "ProcuctDetails") as Max_Price;
Output :
Example-2 :
Finding the maximum product price for a given condition where the product id is 103.
Select DMax("Product_Price", "ProcuctDetails","Product_Id = 103") as Max_Price;
Output :
Similar Reads
DSum() and DAvg() Functions MS Access
In Microsoft Access, domain aggregate functions like DSum() and DAvg() provide a powerful way to calculate summaries of data across tables or queries. These functions allow users to perform calculations dynamically based on specific criteria, making them particularly useful in forms, reports, and qu
4 min read
DVar() and DVarP() Functions MS Access
1. DVar() Function : DVar() Function in MS Access is used to estimate variance across a set of values in a specified set of records (a domain). DVar function evaluates variance across a population sample. Syntax : DVar (expr, domain, criteria) Parameters : This method accepts three-parameter as ment
3 min read
Atn() and Cos() Function in MS Access
Atn() Function : In MS Access, The Atn() function returns the arctangent of a number. It takes a number as a parameter and it will return the arc tangent of that number. It will help to perform the mathematical operation of trigonometry. Syntax : Atn(number) Example1 - SELECT Atn(50) AS AtnNum; Outp
1 min read
Day() and Hour() Function in MS Access
1. Day() Function : Day() function returns the day of the month for a given date. In this function, it will take a date as a parameter and it will return the day of that date. The returned day will between 1 to 31. Syntax : Day(date) Example-1 : SELECT Day(#02/23/2020#); Output - 23 Example-2 : SELE
1 min read
Fix() and Format() Function in MS Access
1. Fix() Function : In MS Access, the fix() function returns the integer part of a number. In this function, a number will be pass as a parameter and it will return the integer part of that number. Syntax : Fix(number) Example-1 : SELECT Fix(-75.43) AS FixNum; Output - FixNum -75 Example-2 : SELECT
2 min read
DDB () and FV() Function Function in MS Access
1. DDB() Function : DDB() Function in MS Access is used to calculate the depreciation of an asset for a specific time period using the double-declining balance method or some other method. The DDB function uses the following formula to calculate depreciation for a given period : Depreciation / perio
4 min read
Abs() and Avg() Function in MS Access
1. Abs() Function : In MS Access, the abs() function returns a positive (absolute) number. In this function, either a positive number or a negative number is passed, and it returns the absolute of that number. It takes a number as a parameter and it returns the positive value of that number. Syntax
1 min read
First() and Last()Function in MS Access
1. First() Function : In MS Access, the First() function is used to return a field value from the first record in the result set returned by a query. Syntax : First(expr) Parameter : expr : It represents a string expression identifying the field that contains the data we want to use or an expression
2 min read
DateDiff() and DatePart() Function in MS Access
The DateDiff() function in MS Access calculates the difference between two dates and returns the result in specified time intervals, such as years, months, or days. The DatePart() function extracts specific components of a date, like a year, month, or day, allowing for detailed analysis and manipula
4 min read
Exp() and Count() Function in MS Access
In MS Access, functions like Exp() and Count() play vital roles in data manipulation and analysis. The Exp() function is used for mathematical computations, specifically to calculate the exponential value of a number, where e (approximately 2.718) is raised to a specified power. In this article, We
3 min read