MS Access Chr() Function

The Chr() function in MS Access converts an ASCII (American Standard Code for Information Interchange) code into its corresponding character. ASCII is a numerical representation of characters, where each character (like 'A', 'b', '!', etc.) has a unique numerical code.



Chr(): Definition and Usage

Chr() is useful when you need to work with the underlying numerical representation of characters, perhaps for character-by-character manipulation, data validation, or specialized text processing. You provide an ASCII code as input, and the function returns the character that corresponds to that code.

Syntax

Syntax

Chr(code)
      

Parameter Values

Parameter Description
code The ASCII number code (an integer) for which you want to get the corresponding character. This is required.

Example

Converting an ASCII Code to a Character

This example shows how to use the Chr() function to convert ASCII code 65 (which represents the uppercase letter 'A') into its character equivalent.

Syntax

SELECT Chr(65) AS CodeToCharacter;
      
Output

CodeToCharacter
----------------
A