qry return no results in given field

R

Rick Stahl

I have a query that contains a union query and 2 other subqueries "A" and
"B". A field that is contained in "A" subquery is returned blank in my
query.

In a separate query this same field is returned properly. This separate
query also contains a union query (same as above) and 2 other queries (one
of them is same as above "A" and "C" different from above).

What would prevent this field from displaying its values in 1 query and not
another ? Like I said, the values for the field are part of the subquery
"A" and should be displayed.

Thanks for any help.
 
J

John W. Vinson

I have a query that contains a union query and 2 other subqueries "A" and
"B". A field that is contained in "A" subquery is returned blank in my
query.

In a separate query this same field is returned properly. This separate
query also contains a union query (same as above) and 2 other queries (one
of them is same as above "A" and "C" different from above).

What would prevent this field from displaying its values in 1 query and not
another ? Like I said, the values for the field are part of the subquery
"A" and should be displayed.

Thanks for any help.

Correct the error in your query.

If you'ld like help doing so, please post the SQL of the query so that we can
see what the problem might be.

John W. Vinson [MVP]
 
R

Rick Stahl

I'm sorry but I cannot seem to correct the query. As requested here is the
SQL of the errorred query:

SELECT TotalGrossWeeklyPay.dtmWorkEndingDate,
TotalGrossWeeklyPay.strFirstName, TotalGrossWeeklyPay.strLastName,
qryHourlyWeeklyTotalWages.dtmPayPeriodStartDate,
qryHourlyWeeklyTotalWages.dtmPayPeriodEndDate, [PayRate] AS Expr1, [Bonus]
AS Expr2, qryHourlyWeeklyTotalWages.txtAcceptable,
qryHourlyWeeklyTotalWages.sngRegHrsWorked,
qryHourlyWeeklyTotalWages.curPayRate,
qryHourlyWeeklyTotalWages.sngDiffHrsWorked,
qryHourlyWeeklyTotalWages.curDiffRate,
qryHourlyWeeklyTotalWages.sngOtherHrsWorked,
qryHourlyWeeklyTotalWages.curOtherRate,
qryHourlyWeeklyTotalWages.sngTotalHrs,
qryHourlyWeeklyTotalWages.curGrossWages, TotalGrossWeeklyPay.curGrossWages
FROM TotalGrossWeeklyPay INNER JOIN qryHourlyWeeklyTotalWages ON
(TotalGrossWeeklyPay.dtmWorkEndingDate=qryHourlyWeeklyTotalWages.dtmWorkEndingDate)
AND
(TotalGrossWeeklyPay.strFirstName=qryHourlyWeeklyTotalWages.strFirstName)
AND (TotalGrossWeeklyPay.strLastName=qryHourlyWeeklyTotalWages.strLastName)
WHERE (((TotalGrossWeeklyPay.Source)="Hourly Only"));

Likewise, here is the SQL of the working query:

SELECT TotalGrossWeeklyPay.dtmWorkEndingDate,
TotalGrossWeeklyPay.strFirstName, TotalGrossWeeklyPay.strLastName,
qrySalaryWeeklyTotalWages.dtmPayPeriodStartDate,
qrySalaryWeeklyTotalWages.dtmPayPeriodEndDate,
qrySalaryWeeklyTotalWages.curPayRate, qrySalaryWeeklyTotalWages.curBonus,
qryHourlyWeeklyTotalWages.txtAcceptable,
qryHourlyWeeklyTotalWages.sngRegHrsWorked,
qryHourlyWeeklyTotalWages.curPayRate,
qryHourlyWeeklyTotalWages.sngDiffHrsWorked,
qryHourlyWeeklyTotalWages.curDiffRate,
qryHourlyWeeklyTotalWages.sngOtherHrsWorked,
qryHourlyWeeklyTotalWages.curOtherRate,
qryHourlyWeeklyTotalWages.sngTotalHrs,
qryHourlyWeeklyTotalWages.curGrossWages, TotalGrossWeeklyPay.curGrossWages
FROM (TotalGrossWeeklyPay INNER JOIN qrySalaryWeeklyTotalWages ON
(TotalGrossWeeklyPay.dtmWorkEndingDate =
qrySalaryWeeklyTotalWages.dtmWorkEndingDate) AND
(TotalGrossWeeklyPay.strLastName = qrySalaryWeeklyTotalWages.strLastName)
AND (TotalGrossWeeklyPay.strFirstName =
qrySalaryWeeklyTotalWages.strFirstName)) LEFT JOIN qryHourlyWeeklyTotalWages
ON (TotalGrossWeeklyPay.dtmWorkEndingDate =
qryHourlyWeeklyTotalWages.dtmWorkEndingDate) AND
(TotalGrossWeeklyPay.strLastName = qryHourlyWeeklyTotalWages.strLastName)
AND (TotalGrossWeeklyPay.strFirstName =
qryHourlyWeeklyTotalWages.strFirstName)
WHERE (((TotalGrossWeeklyPay.Source)="Salary Only"));

Thank you for your generous help.
 
R

Rick Stahl

Happy New Year !

I hate to be a bother but does someone have any suggestions why my query
qrySubtotalHourlyOnly does not return any values for
qryHourlyWeeklyTotalWages.dtmPayPeriodEndDate ? In the original query
(qryHourlyWeeklyTotalWages) the dtmPayPeriodEndDate are displayed fine.
Would it be related to TotalGrossWeeklyPay being a Union ? It makes no
sense to me ! Thank you in advance.



Rick Stahl said:
I'm sorry but I cannot seem to correct the query. As requested here is
the SQL of the errorred query:

SELECT TotalGrossWeeklyPay.dtmWorkEndingDate,
TotalGrossWeeklyPay.strFirstName, TotalGrossWeeklyPay.strLastName,
qryHourlyWeeklyTotalWages.dtmPayPeriodStartDate,
qryHourlyWeeklyTotalWages.dtmPayPeriodEndDate, [PayRate] AS Expr1, [Bonus]
AS Expr2, qryHourlyWeeklyTotalWages.txtAcceptable,
qryHourlyWeeklyTotalWages.sngRegHrsWorked,
qryHourlyWeeklyTotalWages.curPayRate,
qryHourlyWeeklyTotalWages.sngDiffHrsWorked,
qryHourlyWeeklyTotalWages.curDiffRate,
qryHourlyWeeklyTotalWages.sngOtherHrsWorked,
qryHourlyWeeklyTotalWages.curOtherRate,
qryHourlyWeeklyTotalWages.sngTotalHrs,
qryHourlyWeeklyTotalWages.curGrossWages, TotalGrossWeeklyPay.curGrossWages
FROM TotalGrossWeeklyPay INNER JOIN qryHourlyWeeklyTotalWages ON
(TotalGrossWeeklyPay.dtmWorkEndingDate=qryHourlyWeeklyTotalWages.dtmWorkEndingDate)
AND
(TotalGrossWeeklyPay.strFirstName=qryHourlyWeeklyTotalWages.strFirstName)
AND
(TotalGrossWeeklyPay.strLastName=qryHourlyWeeklyTotalWages.strLastName)
WHERE (((TotalGrossWeeklyPay.Source)="Hourly Only"));

Likewise, here is the SQL of the working query:

SELECT TotalGrossWeeklyPay.dtmWorkEndingDate,
TotalGrossWeeklyPay.strFirstName, TotalGrossWeeklyPay.strLastName,
qrySalaryWeeklyTotalWages.dtmPayPeriodStartDate,
qrySalaryWeeklyTotalWages.dtmPayPeriodEndDate,
qrySalaryWeeklyTotalWages.curPayRate, qrySalaryWeeklyTotalWages.curBonus,
qryHourlyWeeklyTotalWages.txtAcceptable,
qryHourlyWeeklyTotalWages.sngRegHrsWorked,
qryHourlyWeeklyTotalWages.curPayRate,
qryHourlyWeeklyTotalWages.sngDiffHrsWorked,
qryHourlyWeeklyTotalWages.curDiffRate,
qryHourlyWeeklyTotalWages.sngOtherHrsWorked,
qryHourlyWeeklyTotalWages.curOtherRate,
qryHourlyWeeklyTotalWages.sngTotalHrs,
qryHourlyWeeklyTotalWages.curGrossWages, TotalGrossWeeklyPay.curGrossWages
FROM (TotalGrossWeeklyPay INNER JOIN qrySalaryWeeklyTotalWages ON
(TotalGrossWeeklyPay.dtmWorkEndingDate =
qrySalaryWeeklyTotalWages.dtmWorkEndingDate) AND
(TotalGrossWeeklyPay.strLastName = qrySalaryWeeklyTotalWages.strLastName)
AND (TotalGrossWeeklyPay.strFirstName =
qrySalaryWeeklyTotalWages.strFirstName)) LEFT JOIN
qryHourlyWeeklyTotalWages ON (TotalGrossWeeklyPay.dtmWorkEndingDate =
qryHourlyWeeklyTotalWages.dtmWorkEndingDate) AND
(TotalGrossWeeklyPay.strLastName = qryHourlyWeeklyTotalWages.strLastName)
AND (TotalGrossWeeklyPay.strFirstName =
qryHourlyWeeklyTotalWages.strFirstName)
WHERE (((TotalGrossWeeklyPay.Source)="Salary Only"));

Thank you for your generous help.


John W. Vinson said:
Correct the error in your query.

If you'ld like help doing so, please post the SQL of the query so that we
can
see what the problem might be.

John W. Vinson [MVP]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top