sql - Access 2007 Left Join doesn't work -
i have 2 tables. table 1 tbl_daysweeksmonths has 1 row each date , it's corresponding week ending date , calendar month. table 2 tbl_callstats shows 1 record per agent per day corresponding call counts , stats etc. not consultants have records every day of week.
to left table 1 (tbl_daysweeksmonths) columns date, week ending, month. right table 2 (tbl_callstats) columns row_date, agent, logid, total calls, talk time.
i want link tbl_callstats tbl_daysweeksmonths date record displayed each agent (based on tbl_daysweeksmonths) if didn't take calls on particular day.
i've tried left join still displays records days calls taken. feel i'm missing simple here. please help.
select date,[week ending],tbl_callstats.agent tbl_daysweeksmonths left join tbl_callstats on tbl_daysweeksmonths.date = tbl_callstats.row_date group date, week, agent
this query gets days , should show agent call in tbl_callstats. takes in consideration there row in tbl_callstats each day , agent.
"select tbl_daysweeksmonths.date, tbl_daysweeksmonths.weekending, tbl_daysweeksmonths.month, tbl_callstats.agent, tbl_callstats.logid, tbl_callstats.totalcalls, tbl_callstats.talktime tbl_daysweeksmonths left join tbl_callstats on tbl_callstats.row_date = tbl_daysweeksmonths.date group tbl_callstats.agent, tbl_daysweeksmonths.date " if not have record in tbl_callstats when there no calls maybe can have table agents , values related them, like, select days joining agents each day , left join callstats...
Comments
Post a Comment