Duane,
I think I had a breakthrough on this today. I changed the NZ function from 0 to use the on hand qty. Preliminary tests look good. I'm testing it on all the data tonight. It takes about an hour to run through all the records. I will let you know tomorrow if it worked. Thanks for your good advice.
Doyce
---In MS_Access_Professionals@yahoogroups.com, <duanehookom@...> wrote :
Doyce,
Sorry about messing up your name. I need more coffee.
I would try move the Nz() to address only the DSum()
Nz(DSum("tnxqty_15","Transaction History","PrtNum_15='" & [PartID] & "' and TNXCDE_15 = 'R' and MAXID > '" & [MAXID] & "'"),0)-[onhand_01] AS LeftSum
Duane
From: MS_Access_Professionals@yahoogroups.com <MS_Access_Professionals@yahoogroups.com> on behalf of winberry.doyce@... [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com>
Sent: Tuesday, September 10, 2019 9:13 AM
To: MS_Access_Professionals@yahoogroups.com <MS_Access_Professionals@yahoogroups.com>
Subject: Re: [MS_AccessPros] Inventory Aging
Sent: Tuesday, September 10, 2019 9:13 AM
To: MS_Access_Professionals@yahoogroups.com <MS_Access_Professionals@yahoogroups.com>
Subject: Re: [MS_AccessPros] Inventory Aging
MAXID | PartID | TDate | COST_01 | TNXQTY_15 | RunTotal | onhand_01 | D | LeftSum | AgeQty |
---|---|---|---|---|---|---|---|---|---|
2792852 | 1001004 | 9/28/2016 | 12.6 | 1 | 1 | 3 | -1 | 0 | 1 |
2248382 | 1001004 | 7/23/2014 | 12.6 | 3 | 5 | 3 | -1 | -1 | 1 |
2248716 | 1001004 | 7/23/2014 | 12.6 | 1 | 2 | 3 | -1 | -2 | 1 |
2248386 | 1001011 | 7/23/2014 | 2.7 | 8 | 9 | 7 | -1 | -6 | 6 |
2248723 | 1001011 | 7/23/2014 | 2.7 | 1 | 1 | 7 | -1 | 0 | 1 |
2248387 | 1001012 | 7/23/2014 | 2.7 | 8 | 9 | 7 | -1 | -6 | 6 |
2248724 | 1001012 | 7/23/2014 | 2.7 | 1 | 1 | 7 | -1 | 0 | 1 |
2785852 | 1001017 | 9/13/2016 | 10.8 | 2 | 2 | 1 | -1 | 0 | 0 |
2785854 | 1001020 | 9/13/2016 | 24.05 | 2 | 2 | 1 | -1 | 0 | 0 |
2785909 | 1001022 | 9/13/2016 | 2.25 | 4 | 4 | 2 | -1 | 0 | 0 |
2785910 | 1001024 | 9/13/2016 | 1.5 | 2 | 2 | 1 | -1 | 0 | 0 |
> '" & [MaxID] & "'")-[onhand_01]),0)),0)<=0,True,False) AS D, Nz((DSum("tnxqty_15","Transaction History","PrtNum_15='" & [PartID] & "' and TNXCDE_15 = '" & "R" & "' and MAXID > '" & [MAXID] & "'")-[onhand_01]),0) AS LeftSum, IIf([RunTotal]<[Onhand_01],[TNXQTY_15],Abs((Nz((DSum("tnxqty_15","TransactionHistory","PrtNum_15='" & [PartID] & "' and TNXCDE_15 = '" & "R" & "' and MAXID > '" & [MaxID] & "'")-[onhand_01]),0)))) AS AgeQty
FROM [Part Master] INNER JOIN [Transaction History] ON [Part Master].PRTNUM_01 = [Transaction History].PRTNUM_15
WHERE ((([Transaction History].TNXCDE_15)="R") AND (([Part Master].onhand_01)>0))
ORDER BY [Transaction History].PRTNUM_15, [Transaction History].TNXDTE_15 DESC;
Doyce
---In MS_Access_Professionals@yahoogroups.com, <duanehookom@...> wrote :
---In MS_Access_Professionals@yahoogroups.com, <r.koelmans@...> wrote :
---In MS_Access_Professionals@yahoogroups.com, <duanehookom@...> wrote :
Hi Art,
I believe you want to start with the number on hand (current inventory) and step backwards chronologically to see when you can account for purchasing a specific quantity and the price paid. The purchase date will identify the bucket the quantity and price go into. When all of the number on hand have been accounted for you are done putting prices and quantities into buckets.
Do you have some sample records and how you would want these reported?
Thanks,
Duane
From: MS_Access_Professionals@yahoogroups.com <MS_Access_Professionals@yahoogroups.com> on behalf of winberry.doyce@... [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com>
Sent: Monday, September 9, 2019 4:36 PM
To: MS_Access_Professionals@yahoogroups.com <MS_Access_Professionals@yahoogroups.com>
Subject: RE: [MS_AccessPros] Inventory Aging
Sent: Monday, September 9, 2019 4:36 PM
To: MS_Access_Professionals@yahoogroups.com <MS_Access_Professionals@yahoogroups.com>
Subject: RE: [MS_AccessPros] Inventory Aging
---In MS_Access_Professionals@yahoogroups.com, <r.koelmans@...> wrote :
__._,_.___
Posted by: winberry.doyce@con-way.com
Reply via web post | • | Reply to sender | • | Reply to group | • | Start a New Topic | • | Messages in this topic (9) |
.
__,_._,___
Tidak ada komentar:
Posting Komentar