I am trying to populate latest date record to be printed for BPA from PO tables in a custom BIP
Per the business requirement, we need to print COO from BPA attached to the shipment, if the shipment lines having country of origin code is NULL, and since there maybe multiple BPAs created against each inventory item lines so we need to print the latest bpa created record, but the max function seems not be working, also i was trying to join PO and WSH tables through below join ids also not to be working
SELECT
pha.segment1 AS po_number,
pol.line_num AS po_line_number,
wdA.delivery_id,
wdd.shipped_quantity,
hou.name AS business_unit_name