Int, Fix Functions

Applies To
Access for Microsoft 365 Access 2024 Access 2021 Access 2019 Access 2016

Returns the integer portion of a number.

Syntax

Int(number)

Fix(number)

The required number argument is a Double or any valid numeric expression. If number contains Null, the function returns Null.

Remarks

Both Int and Fix remove the fractional part of number and return the resulting integer value.

The difference between Int and Fix appears when number is negative. Int returns the first negative integer that is less than or equal to number. Fix returns the first negative integer that is greater than or equal to number. For example, Int converts -8.4 to -9, and Fix converts -8.4 to -8.

Fix(number) is equivalent to:

Sgn(number) * Int(Abs(number))

Query examples

Expression Results
SELECT Int([Discount]) AS Expr1 FROM ProductSales; Removes the fractional part of all the values in the Discount field and returns the resulting integer values. For negative fractions, Int returns the first negative integer that is less than or equal to the number. For example, for a discount value of -223.20, the integer returned is -224.00.
SELECT Fix([Discount]) AS Expr1 FROM ProductSales; Removes the fractional part of all the values in the Discount field and returns the resulting integer values. For negative fractions, Fix returns the first negative integer that is greater than or equal to the number. For example, for a discount value of -223.20, the integer returned is -223.00.

VBA example

Note

The following examples show how to use this function in a Visual Basic for Applications (VBA) module. For more information about working with VBA, select Developer Reference in the drop-down list next to Search, and then enter one or more terms in the search box.

This example shows how the Int and Fix functions return the integer portions of numbers. For a negative number, the Int function returns the first negative integer less than or equal to the number. The Fix function returns the first negative integer greater than or equal to the number.

Dim MyNumber
MyNumber = Int(99.8)    ' Returns 99.
MyNumber = Fix(99.2)    ' Returns 99.
MyNumber = Int(-99.8)    ' Returns -100.
MyNumber = Fix(-99.8)    ' Returns -99.
MyNumber = Int(-99.2)    ' Returns -100.
MyNumber = Fix(-99.2)    ' Returns -99.