Group Query

L

lez

I am sure there is a simple answer to this, but cannot find it. I want to
create a query to simply count the number of calls name in a day.

I have tblcalls with callsID, contactID, df1, notes,

df1 date stamps the record and I simply want a 'count' of df1 for Now()
grouped by contactID.

anyone any suggestions?

Thanks
 
J

John Spencer

I am guessing that DF1 contains a date along with the time. The SQL for the
query would look like the following.

SELECT ContactID
, DateValue(Df1) As DateOnly
, Count(CallsID) as CountCalls
FROM tblCalls
GROUP BY ContactID
, DateValue(Df1)

If you can't figure out how to use this, then post back for instructions on
how to build the query in the query design view instead of in the SQL view.

John Spencer
Access MVP 2002-2005, 2007-2008
Center for Health Program Development and Management
University of Maryland Baltimore County
 
L

Lez

Thanks John,

I have just reposted as I was not sure if my message was clear, the post is
header 'date query'

I am trying to do this is query design window, so help would be appreciated.

Thanks
Lez
 
J

John Spencer

SELECT ContactID
, DateValue(Df1) As DateOnly
, Count(CallsID) as CountCalls
FROM tblCalls
GROUP BY ContactID
, DateValue(Df1)

-- Open a new query
-- Add your table
-- Add the fields ContactId, Df1, and CallsID
-- Change DF1 to DateValue(Df1)
-- Select View: Totals from the menu
-- Change GROUP BY under CallsID to Count
-- Run the query.

John Spencer
Access MVP 2002-2005, 2007-2008
Center for Health Program Development and Management
University of Maryland Baltimore County
 
L

lez

Cheers John, got it now, many thanks


John Spencer said:
SELECT ContactID
, DateValue(Df1) As DateOnly
, Count(CallsID) as CountCalls
FROM tblCalls
GROUP BY ContactID
, DateValue(Df1)

-- Open a new query
-- Add your table
-- Add the fields ContactId, Df1, and CallsID
-- Change DF1 to DateValue(Df1)
-- Select View: Totals from the menu
-- Change GROUP BY under CallsID to Count
-- Run the query.

John Spencer
Access MVP 2002-2005, 2007-2008
Center for Health Program Development and Management
University of Maryland Baltimore County
 
Top