Oldest Material Issued To Job BAQ

We have phantom assemblies that we make to stock and then put into a kit when resources are available. This kit would then have an expiration date of the oldest assembly. We have created a BAQ that displays all the assemblies issued to the job, but we are struggling in limiting this to display on the oldest expiration date the kit now holds. Lack of experience with BAQ’s is greatest setback, any help would be greatly appreciated. Thanks in advance.

Might be helpful to post your query.

oldestfittingkit.baq (42.3 KB)

Out lots don’t expire so don’t have data to try this against, but this may work.

Move PartLot to a new SubQuery add fields Company, PartNum, LotNum and then calculated field: MIN(PartLot.ExpirationDate). Add this new SubQuery to your SubQuery1 and link it to PartTran with the Company, PartNum, LotNum fields

image

1 Like

This is another use for windowed functions. This tutorial is incredibly helpful and once you understand it, you will find plenty of ways to use it.

3 Likes