0

Good time of the day!

Could somebody help - I am trying to retrieve the latest orderers based on the OrderDate, but in the end I still receive the DE with records with random date. My query is the following:

SELECT

ordartdate.[OrderNumber Shop1], 
ordartdate.[Article group],
ordartdate.[Article_image 1], 
ordartdate.OrderDate, 
ordartdate.[E-Mail]

FROM [OrdersArticles] ordartdate

LEFT JOIN

(
SELECT ordartdate.[OrderNumber Shop1], MAX(ordartdate.OrderDate) maxDate
FROM [TEST OrdersArticles] ordartdate
GROUP BY [OrdersArticles]
) c ON 

ordartdate.[OrderNumber Shop1]=c.[OrderNumber Shop1]

AND 

ordartdate.OrderDate=c.maxDate

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.