Grouping

G

Greg

Hello,

A question.

If I have a table like this:

777 555 1111, 7/1/2008, 1, 333
777 555 1111, 6/1/2008, 0, 444
777 555 1111, 7/1/2008, 1, 555

I can group on telephone number (first field) and Date (second field) if
date = 7/1/2008 and sum on third and fourth field without a problem.

But can I get the number of records with the same telephone number?

For example a result that looks like:
777 555 1111(group by), 2(count date), 2 (sum field 3), 888( sum field 4),
and a new field with the result 3 representing the number of records with
the same telephone number(group by number) ??

If someone could give me a suggestion or point me in the right direction I
would appreciate it. Thank you in advance.

Greg
 
J

John Spencer

In a separate query.

SELECT PhoneNumber, Count(PhoneNumber) as CountRecordswithThisPhone
FROM YourTable
GROUP BY PhoneNumber


John Spencer
Access MVP 2002-2005, 2007-2008
The Hilltop Institute
University of Maryland Baltimore County
 
G

Greg

John,
Thank you, I will give it a try!
Greg
John Spencer said:
In a separate query.

SELECT PhoneNumber, Count(PhoneNumber) as CountRecordswithThisPhone
FROM YourTable
GROUP BY PhoneNumber


John Spencer
Access MVP 2002-2005, 2007-2008
The Hilltop Institute
University of Maryland Baltimore County
 

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

Top