Dear All,
I am new to working in access, I have 2 tables, 1 has call data and the other as Aux data,(tblsumDaily - call, tblauxDaily - aux data), I am trying to edit a query I have that will show me all calls from tblsumdaily , everytime I add tblsum daily to the query in design mode, it shows me all the calls the agent has taken for the dates selected, but for all the other data in the aux table, it just repeats the values, can someone help me with the uery code below to get it to show me all the data required for the dates selected, from both tables.
Query for 1 table worrks
SELECT DISTINCT [tblAuxDaily].[AgentName], [tblAuxDaily].[Dates], [tblAuxDaily].[StaffTime], [tblAuxDaily].[Break]
FROM tblAuxDaily LEFT JOIN tblSumDaily ON [tblAuxDaily].[AgentName]=[tblSumDaily].[AgentName]
GROUP BY [tblAuxDaily].[AgentName], [tblAuxDaily].[Dates], [tblAuxDaily].[StaffTime], [tblAuxDaily].[Break]
HAVING (((tblAuxDaily.AgentName)=[Forms]![frmMain]![cboAgentname]) AND ((tblAuxDaily.Dates) Between [Forms]![frmMain]![txtfromdate] And [Forms]![frmMain]![txttodate]));
query when I add tblsumDaily
SELECT DISTINCT tblAuxDaily.AgentName, tblAuxDaily.Dates, tblAuxDaily.StaffTime, tblAuxDaily.Break, tblSumDaily.Calls
FROM tblAuxDaily LEFT JOIN tblSumDaily ON tblAuxDaily.AgentName = tblSumDaily.AgentName
WHERE (((tblAuxDaily.AgentName)=[Forms]![frmMain]![cboAgentname]) AND ((tblAuxDaily.Dates) Between [Forms]![frmMain]![txtfromdate] And [Forms]![frmMain]![txttodate]));
could someone tell me where I am going wrong and what it should do.
Thanks
Thanks Rob.![[yoda] [yoda] [yoda]](/data/assets/smilies/yoda.gif)
I am new to working in access, I have 2 tables, 1 has call data and the other as Aux data,(tblsumDaily - call, tblauxDaily - aux data), I am trying to edit a query I have that will show me all calls from tblsumdaily , everytime I add tblsum daily to the query in design mode, it shows me all the calls the agent has taken for the dates selected, but for all the other data in the aux table, it just repeats the values, can someone help me with the uery code below to get it to show me all the data required for the dates selected, from both tables.
Query for 1 table worrks
SELECT DISTINCT [tblAuxDaily].[AgentName], [tblAuxDaily].[Dates], [tblAuxDaily].[StaffTime], [tblAuxDaily].[Break]
FROM tblAuxDaily LEFT JOIN tblSumDaily ON [tblAuxDaily].[AgentName]=[tblSumDaily].[AgentName]
GROUP BY [tblAuxDaily].[AgentName], [tblAuxDaily].[Dates], [tblAuxDaily].[StaffTime], [tblAuxDaily].[Break]
HAVING (((tblAuxDaily.AgentName)=[Forms]![frmMain]![cboAgentname]) AND ((tblAuxDaily.Dates) Between [Forms]![frmMain]![txtfromdate] And [Forms]![frmMain]![txttodate]));
query when I add tblsumDaily
SELECT DISTINCT tblAuxDaily.AgentName, tblAuxDaily.Dates, tblAuxDaily.StaffTime, tblAuxDaily.Break, tblSumDaily.Calls
FROM tblAuxDaily LEFT JOIN tblSumDaily ON tblAuxDaily.AgentName = tblSumDaily.AgentName
WHERE (((tblAuxDaily.AgentName)=[Forms]![frmMain]![cboAgentname]) AND ((tblAuxDaily.Dates) Between [Forms]![frmMain]![txtfromdate] And [Forms]![frmMain]![txttodate]));
could someone tell me where I am going wrong and what it should do.
Thanks
Thanks Rob.
![[yoda] [yoda] [yoda]](/data/assets/smilies/yoda.gif)