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

Find largest entry in a field by comparing records. 2

Status
Not open for further replies.

Najemikon

Technical User
Mar 5, 2002
168
GB
Does anyone know of a method of comparing records to find the largest contents of one particular field?

I have a database that has several memo fields, but a couple are not being used as I thought they would be. I don't think many (if any) entries go above 255 characters. As the database grows generally, I think I should switch these fields to text. It would be nice though to make them an accurate size, but I don't know what the largest or even average entry is so far.

Cheers,



Jon
 
Create a new query with the following SQL code:

Code:
SELECT MAX (LEN(Fieldname))
FROM tablename

and customise the table and field name to your requirements.

John
 
A starting point (SQL code):
SELECT Min(Len([your field])) As MinLength, Max(Len([your field])) As MaxLength, Avg(Len([your field])) As AvgLength
From yourTable

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Perfect, thank you both for the quick response; I especially like the choice of quick result or detailed! ;)

The first main field I checked was 152 maximum. Hardly warrants a memo field!

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top