Newbie - Summary Query?

G

Guest

Hello All,
I have a table that contains, among other things, phone numbers and the
dates that they were called. What I'm trying to build is a query that will
allow me to enter a beginning date and an end date, and then give me each
number that was called during that range and the number of times it was
called.
I'm able to get a query that gives me each record where the date falls
within the range, but it has a unique row for each call, not each number.
For instance, the output looks like this:

Agent's Number Date
18132532424 1/1/2005
17572200741 1/1/2005
17572200741 1/1/2005
17572200741 1/1/2005
18582455167 1/1/2005

When I'd rather it look like this:
Agent's Number Calls
18132532424 1
17572200741 3
18582455167 1

What I've done so far was done in Design View. I don't have any SQL
experience at all, but here's what Access generated based on what I did:

SELECT tblAllData.[Agent's Number], tblAllData.Date
FROM tblAllData
WHERE (((tblAllData.Date) Between [Begin Date] And [End Date]));

XP Pro, Access 2000.

I'm sure it's simple, but I haven't been able to figure it out using help.
Thanks to all who have suggestions.

Mike
 
G

Guest

Dear mikelee101,

Try using this statement:-
SELECT tblAllData.AgentNumber, Count(tblAllData.dtmDate) AS NoOfDays
FROM tblAllData
GROUP BY tblAllData.AgentNumber;

Should work.
 

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