How to sort a table

Davighi

Registered User.
Local time
Today, 17:02
Joined
Sep 27, 2004
Messages
17
How do I order by length?

Hi I have a database of over 100,000 records with 20+ feilds

One of the feilds is a text feild (250) I need to sort this feild so that it displays the records by length, so I can reduce the longest entries to say 80 characters.

The editing needs to be done by hand rather than chopping entries at the 80 character mark.

Is there a way of sorting the table like this easily, do you use a query or what?

I am a near beginner and am using Access 2002
 
Last edited:
Yes, use a query, you can then use a function to find the field lenth and sort on that
FieldLen:Len([my Field])

HTH

Peter
 
Sorry if it is a dumb question but how do I add it to this sql query

SELECT adverts.title, adverts.name
FROM adverts;

title is the field I need sorting by length
 
Last edited:
SELECT adverts.title, adverts.name
FROM adverts
ORDER BY Len(adverts.name) DESC;

Incidentally, Name is a reserved word in Access and should not be used as a field name.
 
Thanks Bat17 and SJ McAbney for the fast response

I have changed the 'name' field and it works like a dream
 

Users who are viewing this thread

Back
Top Bottom