MS Access Str() Function

The Str() function in MS Access converts a numeric value into its string representation. This is useful when you need to work with numbers as text, perhaps for display purposes, string concatenation, or other text-based operations.



Str(): Definition and Usage

Str() takes a number as input and returns a string that is equivalent to that number. It's a simple but important function for situations where you need to integrate numeric data into strings or for formatting numbers as text.

Syntax

Syntax

Str(number)
      

Parameter Values

Parameter Description
number The number you want to convert to a string. This is required.

Example

Converting a Number to a String

This example converts the number 42 to its string equivalent.

Syntax

SELECT Str(42) AS ConvertToString;
      
Output

ConvertToString
----------------
 42 
      

**Note:** The output includes a leading space to accommodate a potential minus sign. If the input number were negative, the minus sign would appear in the first position, and the number itself would be right-aligned within the field.