I try to get just one record of last Order of everysingle customer. ATM I have this idea but it giving me all of them Date of orders.
I work on dataBase AdventurerWorks2012

```
SELECT
        H.CustomerID                   AS Customer,
        H.SalesOrderID                 AS OrderNumber,
        MAX(CAST(H.OrderDate AS DATE)) AS DateOrder
FROM
        Sales.SalesOrderHeader H
    JOIN
        Sales.SalesOrderDetail D
            ON H.SalesOrderID = D.SalesOrderID
GROUP BY
        H.CustomerID,
        H.SalesOrderID
ORDER BY
        CustomerID;

```