Home page
 
 Home 
 ASP 
 PHP 
 SQL 
 HTML 
 JavaScript 
 Search 
 Contact 
 
Search
or browse popular tags
Access Functions
Subscription

Sign up for the free email newsletter for new tips, tutorials and more. Enter your email address below, and then click the button.

Privacy Policy

RSS Twitter

Access: Asc Function

Print

In Access, the Asc function returns an integer representing the ANSI code corresponding to the first character in a string.

The syntax for the Asc function is:

Asc ( string )

The required string argument is any valid string expression. If the string contains no characters, a run-time error occurs. If more than one character is entered, the function will return the value for the first character and ignore all of the characters after the first.

Example

Asc ( "a" )     returns 97
Asc ( "A" )     returns 65
Asc ( "apple" ) returns 97

VBA Code

Dim MyNumber
MyNumber = Asc("A")

This example returns 65, the ANSI character code for an uppercase letter A. Now the MyNumber variable would contain the value 65.

SQL query

You can also use the Asc function in a query.

SELECT Asc('A') AS Expr1
FROM Orders


If you'd like to see how it works, enter SQL statement and press Execute
 




Tags:

Add To: Add to dzone dzone | Digg this digg | Add to del.icio.us del.icio.us | Stumble it stumbleupon

  • Comments





Copyright © 2005-2014             www.WebCheatSheet.com All Rights Reserved.