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

Join first only from joined table

$
0
0

I'm coming up blank on a way to do this in AX. 

We have a need for the latest internal packing slip ID to be displayed on the VendPackingSlipJournal form. A straight inner join results in multiple records being displayed if there are multiple versions.  A display method is not acceptable to the users as they filter on this field. I have tried every combination of QBDS, Views, and Queries that I can think of.  If I wanted just the internal packing slip ID I could do that easily as well but if we ever need another field from the Version I want that to be available. Maybe I'm just taking the wrong approach? Anyone have any ideas?

I can write it pretty simply in SQL:

SELECT *
FROM VENDPACKINGSLIPJOUR T1
JOIN VENDPACKINGSLIPVERSION T2
ON T2.RECID =
(
    SELECT TOP 1 RECID 
    FROM VENDPACKINGSLIPVERSION T3
    WHERE T3.VENDPACKINGSLIPJOUR = T1.RECID
	ORDER BY T3.VERSIONDATETIME DESC
)
--WHERE T1.PURCHID = 'PO1345678'



Viewing all articles
Browse latest Browse all 72043

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>