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: Len Function

Print

In Access, the Len function returns the length of the specified string.

The syntax for the Len function is:

Len ( string )

The required string argument is any valid string expression. If the argument to Len is Null, the function returns a Null.

Example

Len ("access")                         returns 6
Len ("webcheatsheat.com")      returns 17
Len ("hello world")                   returns 11

VBA Code

Dim MyNumber As Long
Dim MyString As String
MyString = "WebCheatSheet.com"
MyNumber = Len(MyString)

This example uses Len to return the number of characters in a string. Now the MyNumber variable would contain the value 17.

SQL query

You can also use the Asc function in a query.

SELECT Len([ItemDesired]) 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.