Quantcast
Channel: Microsoft Dynamics AX Forum - Recent Threads
Viewing all articles
Browse latest Browse all 175888

RE: GL Posting Date in ProdTable

$
0
0

I tested the theory that ProdTable.RealDate should be equal to MAX(InventTrans.DateFinancial), and across all 270k ProdTable records in my business database where the order was Ended, they are identical.

Here's a quick query I used to look for cases where they were different, and 0 records returned.

select p.[PARTITION], p.DATAAREAID, p.PRODID, p.REALDATE, MAX(t.DATEFINANCIAL) AS DATEFINANCIAL

 from PRODTABLE p

 join INVENTTRANSORIGIN o ON o.[PARTITION] = p.[PARTITION] AND o.DATAAREAID = p.DATAAREAID AND o.REFERENCEID = p.PRODID AND o.REFERENCECATEGORY = 2

 join INVENTTRANS t ON t.[PARTITION] = o.[PARTITION] AND t.DATAAREAID = o.DATAAREAID AND t.INVENTTRANSORIGIN = o.RECID

 where t.STATUSISSUE <= 1 AND t.STATUSRECEIPT <= 1

   and p.PRODSTATUS = 7  -- 7=ProdStatus::Ended

 group by p.[PARTITION], p.DATAAREAID, p.PRODID, p.REALDATE

 having p.REALDATE <> MAX(t.DATEFINANCIAL)  -- where different


Viewing all articles
Browse latest Browse all 175888

Trending Articles