Skip to content
Related Articles

Related Articles

Chr() and Asc() Function in MS Access

View Discussion
Improve Article
Save Article
  • Last Updated : 21 Aug, 2020

1. CHR() Function :
The Chr() function returns the character for the given ASCII number code. The Chr function takes an integer as a parameter and returns the respective character. It works opposite to ASC() function.

Syntax –

Chr(ASCII number code)

Parameter – Required; An integer.
Return – A character.

Example –

SELECT Chr(75) 
AS NumberCodeToCharacter;

Output –

NumberCodeToCharacter
K



2. ASC() Function :
The ASC() function returns the ASCII value of the character. If more than one character is passed in the function then it will return the ASCII value of the first character otherwise ASCII value of the specified character.

Syntax –

ASC(Character)

Parameter – Required; A character or a string.
Return – ASCII value; An Integer value.

Example –


Table – Student

STUDENTNAMECOURSE
GFG_USER1OOPS
XYZDSA SELF PACED

SELECT STUDENT, Asc(STUDENTNAME) 
AS NumCodeOfFirstChar
FROM STUDENT;

Output –

STUDENTNumCodeOfFirstChar
GFG_USER1107
XYZ130

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!