Groundrush
Registered User.
- Local time
- Today, 22:19
- Joined
- Apr 14, 2002
- Messages
- 1,376
I know I have posted this before but I am still unable to sort this one out
I have a qry that that has an equal join between 2 other qrys, which works fine if there is data in both.
As soon as one of the qrys has no data to pull through it will not read the qry that has
I need something that will except both regardless of which qry has data to pull through...........if that makes any sense!
this is my qry:
SELECT qryHolidayHalfDayCount.ResourceName, Nz([HolidayCount],0)+Nz([HolidayHalfDayCount],0)/2 AS HolidaysTaken
FROM qryHolidayFullDayCount INNER JOIN qryHolidayHalfDayCount ON qryHolidayFullDayCount.ResourceName = qryHolidayHalfDayCount.ResourceName;
this is what "FOFA" has suggested:
"Your query is not what you want. It is because you have a equal join between the two querys that means ONLY if both are present. What you really need is a UNION ALL query that takes all the rows from the halfday count (divides by two) and a one that takes all the rows from the holiday count, groups by resourcename and sums the counts up. Basically"
I think FOFA'S suggestion is the way to go.
can anyone help me to get there?
this is my attempt at a Union All qry:
SELECT [ResourceName],[HolidayHalfDayCount]
FROM [qryHolidayHalfDayCount]
UNION ALL SELECT [ResourceName],[HolidayCount]
FROM [qryHolidayFullDayCount];
Thanks
I have a qry that that has an equal join between 2 other qrys, which works fine if there is data in both.
As soon as one of the qrys has no data to pull through it will not read the qry that has
I need something that will except both regardless of which qry has data to pull through...........if that makes any sense!
this is my qry:
SELECT qryHolidayHalfDayCount.ResourceName, Nz([HolidayCount],0)+Nz([HolidayHalfDayCount],0)/2 AS HolidaysTaken
FROM qryHolidayFullDayCount INNER JOIN qryHolidayHalfDayCount ON qryHolidayFullDayCount.ResourceName = qryHolidayHalfDayCount.ResourceName;
this is what "FOFA" has suggested:
"Your query is not what you want. It is because you have a equal join between the two querys that means ONLY if both are present. What you really need is a UNION ALL query that takes all the rows from the halfday count (divides by two) and a one that takes all the rows from the holiday count, groups by resourcename and sums the counts up. Basically"
I think FOFA'S suggestion is the way to go.
can anyone help me to get there?
this is my attempt at a Union All qry:
SELECT [ResourceName],[HolidayHalfDayCount]
FROM [qryHolidayHalfDayCount]
UNION ALL SELECT [ResourceName],[HolidayCount]
FROM [qryHolidayFullDayCount];
Thanks