Sqr Function

Returns a Double specifying the square root of a number.

Syntax

Sqr(number)

The required number argument (argument: A value that provides information to an action, an event, a method, a property, a function, or a procedure.) is a Double (Double data type: A fundamental data type that holds double-precision floating-point numbers. It's stored as a 64-bit number ranging in value from approximately -1.797E308 to -4.940E-324 (negative), from 4.94E-324 to 1.797E308 (positive), and 0.) or any valid numeric expression (numeric expression: Any expression that evaluates to a number. The expression can be any combination of variables, constants, functions, and operators.) greater than or equal to zero.

Example

 Note   Examples that follow demonstrate the use of 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 enter one or more terms in the search box.

This example uses the Sqr function to calculate the square root of a number.

Dim MySqr
MySqr = 4    ' Returns 2.
MySqr = 23    ' Returns 4.79583152331272.
MySqr = 0    ' Returns 0.
MySqr = -4    ' Generates a run-time error.

      
 
 
Applies to:
Access 2007