MS Access IsNumeric() Function
The IsNumeric()
function in MS Access checks if a given expression can be evaluated as a number. This is an extremely useful function for data validation, particularly when dealing with data that might contain mixed text and numbers or non-numeric values.
IsNumeric(): Definition and Usage
IsNumeric()
is commonly used to ensure data integrity, preventing errors caused by non-numeric data in calculations or other operations that require numerical input. The function returns True
(-1) if the expression can be interpreted as a number (integer, decimal, etc.), and False
(0) otherwise.
Syntax
Syntax
IsNumeric(expression)
Parameter Values
Parameter | Description |
---|---|
expression |
The value or expression you want to check. This is required. |
Examples
Testing a Numeric Value
This example checks if the number 1030 is numeric (it is!).
Syntax
SELECT IsNumeric(1030);
Output
True (-1)
Testing Non-Numeric Text
This example checks if "Hello" is numeric (it's not!).
Syntax
SELECT IsNumeric("Hello");
Output
False (0)
Testing a Numeric String
This example checks if the string "1030" is numeric (it is!).
Syntax
SELECT IsNumeric("1030");
Output
True (-1)