Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Find the length of a text field

Status
Not open for further replies.

lwrcasep

Technical User
Nov 15, 2002
13
US
Hello!

I am having a problem. I want to get the length of a text field. Trying to do a len(table) will give me ODBC message: Argument data type text is incalid for argument 1 of len function.

Does anyone have a way to get the length of a text field?

Thanks!
 
Hi,

Have a look at DATALENGTH funtion in SQL BOL....


Sunil
 
The DATALENGTH() function will return the number of bytes used to store a value. For text type this will be equal to the number of characters. For ntext, this will be twice the number of characters.

Look it up in BOL for more details. --James
 
Tried it and it worked. Thanks a bunch!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top