J
Jon
I've been asked to come up with a report and I'm having difficulty with
my limited Access skills in trying to construct the Access query
that'll get me what they want. I'm hoping someone can help me out
here...
I've gotten it the background work down so there are two subqueries
which I now need to join together for the final output; let's call them
qryEveryTime and qryDownTime. qryEveryTime has the following fields:
Date, ShiftNum, Actual, Est
qryDownTime has the following fields:
Date, ShiftNum, Down
The final value which I need to come up with is this: Est/(Actual-Down)
Here's the gotcha which is giving me a headache: while Date and
ShiftNum are the same values in both queries, qryDownTime will not
always have a value for each occurance in qryEveryTime. Here's a small
snippet of the output for each subquery:
qryEveryTime
Date ShiftNum Actual Est
02-Oct-06 1 473 378
02-Oct-06 2 440 370
03-Oct-06 1 392 421
03-Oct-06 2 187 168
04-Oct-06 1 474 230
04-Oct-06 2 262 220
05-Oct-06 1 470 357
05-Oct-06 2 430 289
06-Oct-06 1 469 219
06-Oct-06 2 444 382
qryDownTime
Date ShiftNum Down
02-Oct-06 1 93
02-Oct-06 2 4
03-Oct-06 1 10
04-Oct-06 1 31
05-Oct-06 1 146
06-Oct-06 1 120
06-Oct-06 2 65
As you can see, there can be a value in qryEveryTime that is not
duplicated in qryDownTime. For instance the proper calculation for
shift 1 on Oct 2 should be 378/(473-93) or .9947, while the result for
shift 2 on 10/5 should be 289/430 or .6721. Yet the query I have right
now:
SELECT qryDownTime.Date, qryDownTime.ShiftNum, qryDownTime.Process,
qryEveryTime!Est/(qryEveryTime!Actual-qryDownTime!Down) AS TotalEff
FROM qryDownTime, qryEveryTime
WHERE (((qryEveryTime.Date)=[qryDownTime]![Date]) AND
((qryEveryTime.ShiftNum)=[qryDownTime]![ShiftNum]) AND
((qryEveryTime.Process)=[qryDownTime]![Process]));
is not returning any value at all for shift 2 for 10/5.
What am I doing wrong, and what should I be doing instead here??
my limited Access skills in trying to construct the Access query
that'll get me what they want. I'm hoping someone can help me out
here...
I've gotten it the background work down so there are two subqueries
which I now need to join together for the final output; let's call them
qryEveryTime and qryDownTime. qryEveryTime has the following fields:
Date, ShiftNum, Actual, Est
qryDownTime has the following fields:
Date, ShiftNum, Down
The final value which I need to come up with is this: Est/(Actual-Down)
Here's the gotcha which is giving me a headache: while Date and
ShiftNum are the same values in both queries, qryDownTime will not
always have a value for each occurance in qryEveryTime. Here's a small
snippet of the output for each subquery:
qryEveryTime
Date ShiftNum Actual Est
02-Oct-06 1 473 378
02-Oct-06 2 440 370
03-Oct-06 1 392 421
03-Oct-06 2 187 168
04-Oct-06 1 474 230
04-Oct-06 2 262 220
05-Oct-06 1 470 357
05-Oct-06 2 430 289
06-Oct-06 1 469 219
06-Oct-06 2 444 382
qryDownTime
Date ShiftNum Down
02-Oct-06 1 93
02-Oct-06 2 4
03-Oct-06 1 10
04-Oct-06 1 31
05-Oct-06 1 146
06-Oct-06 1 120
06-Oct-06 2 65
As you can see, there can be a value in qryEveryTime that is not
duplicated in qryDownTime. For instance the proper calculation for
shift 1 on Oct 2 should be 378/(473-93) or .9947, while the result for
shift 2 on 10/5 should be 289/430 or .6721. Yet the query I have right
now:
SELECT qryDownTime.Date, qryDownTime.ShiftNum, qryDownTime.Process,
qryEveryTime!Est/(qryEveryTime!Actual-qryDownTime!Down) AS TotalEff
FROM qryDownTime, qryEveryTime
WHERE (((qryEveryTime.Date)=[qryDownTime]![Date]) AND
((qryEveryTime.ShiftNum)=[qryDownTime]![ShiftNum]) AND
((qryEveryTime.Process)=[qryDownTime]![Process]));
is not returning any value at all for shift 2 for 10/5.
What am I doing wrong, and what should I be doing instead here??