M
Maxwell Britman
Hi,
I have a problem with a query which just isnt working.
I have a customers table with JoinDate and AgentID (FK from Agents
table). I would like a query to show total sales for each Agent today
or on a certain date.
The sql query I have is:
SELECT DISTINCTROW tblAgents.AgentName, Count(*) AS [Count Of
tblCustomers]
FROM tblAgents INNER JOIN tblCustomers ON tblAgents.AgentID =
tblCustomers.AgentID
WHERE (((tblCustomers.ConnectionDate)=Now()))
GROUP BY tblAgents.AgentName
ORDER BY tblAgents.AgentName;
A similar query without the WHERE condition works fine, but this does
not. Any clues as to what I'm doing wrong? or is this not possible?
I also tried using begin and end date variables via a dialog as
recommended on Allen Browne's website, but that didnt help. He
mentions that this wont work with aggregate or Transform queries. Is
this the case here with mine?
Any help would be appreciated.
Thanks in advance
Max
I have a problem with a query which just isnt working.
I have a customers table with JoinDate and AgentID (FK from Agents
table). I would like a query to show total sales for each Agent today
or on a certain date.
The sql query I have is:
SELECT DISTINCTROW tblAgents.AgentName, Count(*) AS [Count Of
tblCustomers]
FROM tblAgents INNER JOIN tblCustomers ON tblAgents.AgentID =
tblCustomers.AgentID
WHERE (((tblCustomers.ConnectionDate)=Now()))
GROUP BY tblAgents.AgentName
ORDER BY tblAgents.AgentName;
A similar query without the WHERE condition works fine, but this does
not. Any clues as to what I'm doing wrong? or is this not possible?
I also tried using begin and end date variables via a dialog as
recommended on Allen Browne's website, but that didnt help. He
mentions that this wont work with aggregate or Transform queries. Is
this the case here with mine?
Any help would be appreciated.
Thanks in advance
Max