L
Lisa Jones
Hello,
I hope one of you gurus out there can help!
I have a table similar to this:
Part Qty UnitCost ExtendedCost Period
123a 2 .25 .50 2003-05
123a 2 .23 .46 2003-04
123a 2 .20 .40 2003-03
456b 10 .30 3.00 2003-05
456b 8 .30 2.40 2003-04
456b 8 .29 2.32 2003-02
I want to create a query that separates this data
into "Prior" and "Current" based on input from the user.
Here is how I want the query to look:
Part PriorQty CurrQty PriorUnit$ CurrUnit$
123a 2 2 .23 .25
456b 8 10 .30 .30
I tried using the SELECT statement as follows in each
field:
PriorQty: (SELECT [Qty] FROM
WHERE [Period]=[Enter
PriorPd as YYYY-MM].)
Usually this gives me a message that "No more than one
record will be returned." I tried adding the ALL
predicate. Still didn't work.
I need this Query to create a report that will show Prior
month data, Current month data, and a Variance. I don't
want to dump this into Excel, but I've been working on it
for three days now and nothing I'm doing in Access seems
to work.
Thanks for any ideas!
/Lisa
I hope one of you gurus out there can help!
I have a table similar to this:
Part Qty UnitCost ExtendedCost Period
123a 2 .25 .50 2003-05
123a 2 .23 .46 2003-04
123a 2 .20 .40 2003-03
456b 10 .30 3.00 2003-05
456b 8 .30 2.40 2003-04
456b 8 .29 2.32 2003-02
I want to create a query that separates this data
into "Prior" and "Current" based on input from the user.
Here is how I want the query to look:
Part PriorQty CurrQty PriorUnit$ CurrUnit$
123a 2 2 .23 .25
456b 8 10 .30 .30
I tried using the SELECT statement as follows in each
field:
PriorQty: (SELECT [Qty] FROM
PriorPd as YYYY-MM].)
Usually this gives me a message that "No more than one
record will be returned." I tried adding the ALL
predicate. Still didn't work.
I need this Query to create a report that will show Prior
month data, Current month data, and a Variance. I don't
want to dump this into Excel, but I've been working on it
for three days now and nothing I'm doing in Access seems
to work.
Thanks for any ideas!
/Lisa