Microsoft Office Online
Sign in to My Office Online (What's this?) | Sign in

 
 
Microsoft Office Access
Search
Search
 
Check for updates: (c) Microsoft
Office downloads
 
 
 
Warning: You are viewing this page with an unsupported Web browser. This Web site works best with Microsoft Internet Explorer 6.0 or later, Firefox 1.5, or Netscape Navigator 8.0 or later. Learn more about supported browsers.

Email this linkEmail this link Printer-Friendly VersionPrinter-Friendly Version Bookmark and ShareShare
Calculate the length of a text value
 

The following table lists examples of expressions that use the Len function to calculate the length of a text value.

You can use these expressions in calculated controls (calculated control: A control that is used on a form, report, or data access page to display the result of an expression. The result is recalculated each time there is a change in any of the values on which the expression is based.) on forms, reports, and data access pages (data access page: A Web page, published from Access, that has a connection to a database. In a data access page, you can view, add to, edit, and manipulate the data stored in the database. A page can also include data from other sources, such as Excel.).

Expression Description
=Len("Hello") Displays the number of characters in the string. This expression returns the value 5.
=Len("Hello World") Displays the number of characters, including spaces. This expression returns the value 11.
=Len([FirstName]) Returns the number of characters in the FirstName field.

You can use these expressions in a calculated field in a query.

Expression Description
MyCount: Len("Hello") Displays in the MyCount field the number of characters in the string "Hello."
MyCount: Len([FirstName]) Displays in the MyCount field the number of characters in the FirstName field.