Afternoon
I have a query and need to achieve the following:
- Count number of calls from agents from tbl_Genesys_Weekly
- Count number of times agents appear in tbl_ReferralsYTD based on the week commencing date from tbl_Genesys_Weekly + 7
So far I have this and its not going to plan at all:
How I want the table to be lay out:
Agent | Referral Count | Call Count | Week Commencing Date
Any help is appreciated, thank you
I have a query and need to achieve the following:
- Count number of calls from agents from tbl_Genesys_Weekly
- Count number of times agents appear in tbl_ReferralsYTD based on the week commencing date from tbl_Genesys_Weekly + 7
So far I have this and its not going to plan at all:
Code:
SELECT tbl_ReferralsYTD.USERID, Count(tbl_ReferralsYTD.USERID) AS CountOfUSERID, tbl_Genesys_Weekly.Field7 AS Calls, tbl_Genesys_Weekly.WC_Date, tbl_ReferralsYTD.NOTE_EFTV_DT
FROM tbl_ReferralsYTD LEFT JOIN tbl_Genesys_Weekly ON tbl_ReferralsYTD.USERID = tbl_Genesys_Weekly.Field5
GROUP BY tbl_ReferralsYTD.USERID, tbl_Genesys_Weekly.Field7, tbl_Genesys_Weekly.WC_Date, tbl_ReferralsYTD.NOTE_EFTV_DT
ORDER BY tbl_Genesys_Weekly.WC_Date DESC;
How I want the table to be lay out:
Agent | Referral Count | Call Count | Week Commencing Date
Any help is appreciated, thank you