Sort Criteria

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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?
 
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
 
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top