finding max, avg, min length of a field

J

Jeff

Hi all,
I have a field xxx in table1. I need to find out what's the longest
length (max(len)) and the shortest length, and the average characters on the
field. Can someone please help me with the query?

Thanks,
 
M

Marshall Barton

Jeff said:
I have a field xxx in table1. I need to find out what's the longest
length (max(len)) and the shortest length, and the average characters on the
field. Can someone please help me with the query?


Strange request.

Based on what you've said, aquery for that could be:

SELECT Max(Len(xxx)) As MaxLen,
Min(Len(xxx)) As MinLen,
Avg(Len(xxx)) As AvgLen
FROM table1
 
J

John Spencer

Perhaps

SELECT Max(Len(SomeField)) as Longest,
Min(Len(SomeField)) as Shortest,
Avg(Len(SomeField)) as AvgLength
FROM YOURTable
 
Top