Help-
Below are the four fields from edw.CDHDR table. I need the most recent date output from field UDATE for each PO, POITEM AND POLINE. Field UDATE has multiple dates output. I only need it to output the most recent date for each of the other 3 fields. Thanks
SELECT
cdhdr.UDATE AS CHANGE_DT,
cdhdr.OBJ AS PO,
cdhdr.TABKEY AS TABKEY,
SUBSTRING (TABKEY, 14,5) AS POITEM,
RIGHT(TABKEY, LENGTH(TABKEY)-19) AS POLINE
FROM edw.CDHDR