It turned out that it will not work:
There has been several problems in my query:
1- According to Paul Way's reply, my fetch xml was missing aggregate="true"
2- Aggregate functions won't work with Order
attribute
3- If I'm going to retrieve attributes while using the aggregate function I have to groupby
them and add an alias
4- Aggregate function MAX cannot be applied on Date types.
So my other solution is to retrieve all the dates in descending order and then I will use the first entity retrieved.