spartansFC
Programmer
Hi
I need to show calculated fees for all 52 weeks of the year, if there are no fees for a certain week, i need to show a zero for that week.
my first query lists the weeks, the SQL is:
and the joined query has
i'm not sure if i've joined the 2 queries together properly or if i have to use a null as a criteria on one of the fields.
Mikie
I need to show calculated fees for all 52 weeks of the year, if there are no fees for a certain week, i need to show a zero for that week.
my first query lists the weeks, the SQL is:
Code:
SELECT tblDates.FinYrGrouping, tblDates.strWklyStudentCostsWkNo, tblDates.strWklyStudentCosts
FROM tblDates
GROUP BY tblDates.FinYrGrouping, tblDates.strWklyStudentCostsWkNo, tblDates.strWklyStudentCosts
HAVING (((tblDates.FinYrGrouping)="2016"));
and the joined query has
Code:
SELECT qryBooking3Calculations.lngChildID, qryBooking3Calculations.FinYrGrouping, qryBooking8StudentWeeklyCostsWkNumbers.strWklyStudentCostsWkNo, qryBooking3Calculations.strWklyStudentCostsWkNo, qryBooking3Calculations.strWklyStudentCosts, Sum(qryBooking3Calculations.ChargeableSessions) AS SumOfChargeableSessions, qryBooking3Calculations.ActRate, Sum([ChargeableSessions]*[ActRate]) AS weeklycost
FROM qryBooking8StudentWeeklyCostsWkNumbers LEFT JOIN qryBooking3Calculations ON qryBooking8StudentWeeklyCostsWkNumbers.strWklyStudentCostsWkNo = qryBooking3Calculations.strWklyStudentCostsWkNo
GROUP BY qryBooking3Calculations.lngChildID, qryBooking3Calculations.FinYrGrouping, qryBooking8StudentWeeklyCostsWkNumbers.strWklyStudentCostsWkNo, qryBooking3Calculations.strWklyStudentCostsWkNo, qryBooking3Calculations.strWklyStudentCosts, qryBooking3Calculations.ActRate
HAVING (((qryBooking3Calculations.lngChildID)=2180) AND ((qryBooking3Calculations.FinYrGrouping)="2016") AND ((qryBooking3Calculations.strWklyStudentCostsWkNo)>="01" And (qryBooking3Calculations.strWklyStudentCostsWkNo)<="53"));
i'm not sure if i've joined the 2 queries together properly or if i have to use a null as a criteria on one of the fields.
Mikie