Hi
I have a table 'Calls' with the following fields:
Call_Ref
Call_Type
Status
User_ID
I wish to produce a query/report that displays the fields, Call_Ref
Call_Type & Status PER User_ID and sums the total of calls, i.e.
User 1
Call Ref Call_Type Status Total Calls/User 1
User 2
Call Ref Call_Type Status Total Calls/User 2
and so on...
I have so far created the following SQL statement, which is close, but does not appear to COUNT and GROUP correctly. Note: the text boxes are 2 dates
----
SELECT [User].[User_ID], Calls.Call_Type, Calls.Status, COUNT ([User].[User_ID])
FROM Calls INNER JOIN [User] ON [Calls].[User_ID]=[User].[User_ID]
WHERE ((([Calls].[Date_Time]) Between [Forms]![frmCallsQuery]![Text1].[Value] And DateAdd("d",1,[Forms]![frmCallsQuery]![Text2].[Value])))
GROUP BY [User].[User_ID], Calls.Call_Type, Calls.Status;
----
Can anyone point me in the right direction, as I feel it is very close to the correct statement, but i just cannot spot the error!
Thanks in advance :s
I have a table 'Calls' with the following fields:
Call_Ref
Call_Type
Status
User_ID
I wish to produce a query/report that displays the fields, Call_Ref
Call_Type & Status PER User_ID and sums the total of calls, i.e.
User 1
Call Ref Call_Type Status Total Calls/User 1
User 2
Call Ref Call_Type Status Total Calls/User 2
and so on...
I have so far created the following SQL statement, which is close, but does not appear to COUNT and GROUP correctly. Note: the text boxes are 2 dates
----
SELECT [User].[User_ID], Calls.Call_Type, Calls.Status, COUNT ([User].[User_ID])
FROM Calls INNER JOIN [User] ON [Calls].[User_ID]=[User].[User_ID]
WHERE ((([Calls].[Date_Time]) Between [Forms]![frmCallsQuery]![Text1].[Value] And DateAdd("d",1,[Forms]![frmCallsQuery]![Text2].[Value])))
GROUP BY [User].[User_ID], Calls.Call_Type, Calls.Status;
----
Can anyone point me in the right direction, as I feel it is very close to the correct statement, but i just cannot spot the error!
Thanks in advance :s