Get the DB to tell you the maximum length of the field. Assuming a well-trimmed varchar field called 'reason':
select max( len( reason ) ) from table;
If the field is fixed length or can having space padding, then you'd need to trim them up. The functions for that tend to vary from DB to DB.
In reply to Re: Getting length of longest value in a column
by BrowserUk
in thread Getting length of longest value in a column
by Qukz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |