• satish,

    Take a closer look at my earlier query. The DELETE FROM Orders FROM Orders was actually not a typo, although I admit that the SQL syntax in this situation is extremely confusing. Here's your query:

    
    
    DELETE FROM WTRDET
    FROM WTRDET
    INNER JOIN
    (
    SELECT Order_NBR ,Line_NBR, MAX(Ship_Date) as MaxShipDate
    FROM WTRDET GROUP BY Order_NBR ,Line_NBR
    ) AS dt
    ON WTRDET.Order_NBR = dt.Order_NBR
    AND WTRDET.Line_NBR = dt.Line_NBR
    AND WTRDET.Ship_Date < dt.MaxShipDate