ERP 9 BAQ last order date

I thought this would be easy - finding the last order date by part. I get an error Contact your system administrator. But the Analyze says Syntax OK

I group by OrderHed and calculate Maximim(OrderHed.OrderDate)


Try for maximum of Order number and then get the date.

Now I get this:

OrderHed Company must be a quoted constant or an unabbreviated, unambiguous buffer/field reference for buffers known to query . (7328)

I am only displaying Partnum and MAximum(OrderNum)