Good afternoon,
I'm a learner when it comes to access SQL and would like some help if possible
I have created a "Union All" query which is great, but the 2 queries I am joining togther are joining under each other. I beleive as I want to add the second query to the right I would need to use a join but I am unsure how to join them.
Can anyone show me how to complete this as a join or point me to somewhere online I can read and understand and attempt myself as I am unsure how to join 1 to the other on the [DL]
thanks
Gavin
I'm a learner when it comes to access SQL and would like some help if possible
I have created a "Union All" query which is great, but the 2 queries I am joining togther are joining under each other. I beleive as I want to add the second query to the right I would need to use a join but I am unsure how to join them.
Can anyone show me how to complete this as a join or point me to somewhere online I can read and understand and attempt myself as I am unsure how to join 1 to the other on the [DL]
Code:
SELECT Table1.[DL], Sum(IIf([CS]="Pass",1,0))/Sum(IIf([Q1]="Yes",1,0)) AS [Last Week]
FROM Table1, PreviousWeek
WHERE (((Table1.[Call Marked Date]) Between [PreviousWeek].[FromDate] And [PreviousWeek].[ToDate]))
GROUP BY Table1.[DL]
HAVING (((Table1.[DL])<>"Team1"));
UNION ALL SELECT Table1.[DL], Avg(IIf([CS]="Pass",1,0))/Avg(IIf([Q1]="Yes",1,0)) AS [5 Wk Avg]
FROM Table1, FiveWeek
WHERE (((Table1.[Call Marked Date]) Between [FiveWeek].[FromDate] And [FiveWeek].[ToDate]))
GROUP BY Table1.[DL], "5 Wk Avg"
HAVING (((Table1.[DL])<>"Team1"));
thanks
Gavin