Sort Criteria

E

Erika

I have a field that contains phone numbers called, the phone number is listed
every time it was called - I want to find a way to sort by phone number so it
lists the phone number that is called the most to the least?

Any ideas?
 
S

Sprinks

Hi, Erika.

You need a totals query. Start a new query based on your table. Select the
Phone Number field first, then the primary key field. Change to Totals with
View, Totals. Accept the default "Group By" for the Phone number field, but
change the "Group By" to "Count" in the primary key field. Add Descending
sort to the Primary Key field.

The SQL will look something like:

SELECT Calls.Phone, Count(Calls.ID) AS CountOfID
FROM Calls
GROUP BY Calls.Phone
ORDER BY Count(Calls.ID) DESC;

Hope that helps.
Sprinks
 
W

Wayne Morgan

SELECT Table2.Field1, Table2.Field2, Table2.Field3
FROM Table2
ORDER BY DCount("*","Table2","Field1='" & [Field1] & "'") DESC;

Where Field1 is the phone number field and is of Text data type.
 
Top