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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Select text length

Status
Not open for further replies.

TysonLPrice

Programmer
Jan 8, 2003
859
US
I posted this once and got a response and made note of it. I can't find it.

I need to find out the lengths of a text field for a conversion. This generates an error:

Code:
select len(injurydescr) 'ctr' from claim where fkemployeraddress = 47556 order by ctr desc

Server: Msg 8116, Level 16, State 1, Line 1
Argument data type text is invalid for argument 1 of len function.

I googled and got this but it's not what I need.

Code:
SELECT DATALENGTH(injurydescr) AS TEXTFieldSize 
from claim where fkemployeraddress = 47556

How get I get the length of the date for the columns?
 
My bad...

SELECT DATALENGTH(injurydescr) 'ctr'
from claim where fkemployeraddress = 47556 order by ctr desc

works. I was hitting the worng database (test).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top