You can't apply max() to a text datatype. So how about:

SELECT     MAX(LEN(CAST(textdatafield AS nvarchar(4000))))

If the result is < 4000 then it will work. If not, it won't. Or you
could use varchar(8000).

Matthew Walker
http://www.matthewwalker.net.nz/



> -----Original Message-----
> From: Lee Fuller [mailto:leelistnew@;primedna.net]
> Sent: Friday, 25 October 2002 8:26 a.m.
> To: CF-Talk
> Subject: Max length of Text Data?
> 
> 
> Someone help me out here.. brain-fart occurring..
> 
> Need to look at all the values in the ntext field of a datasource,
> calculate the length (in characters) of the data contained in each
> field, and select only the longest field, then display it's length.
> 
> So.. Something like "Max(Len(textdatafield)))"  sorta..
> 
> Ideas?
> 
> TTAIA
> 
> 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Get the mailserver that powers this list at http://www.coolfusion.com

Reply via email to