Latest Date per product

georg7

Registered User.
Local time
Yesterday, 21:39
Joined
Sep 3, 2019
Messages
84
HI guys,
I want a query where I can see the product and the latest date. Is this possible? Can someone help ?


Best regards
Georg
 

Attachments

  • aaa.JPG
    aaa.JPG
    19.8 KB · Views: 112
Create a query and add Feld1 and Feld2.
Click the totals button on the ribbon to make it an aggregate query.
Both fields will now show Group By in the Totals row.
Change that to Max for your Feld2.
 
1. create an aggregate query - call it say qryLatest

Code:
SELECT FELD1, Max(Feld2) as Latest
FROM Tabelle1
GROUP BY FELD1

2. Create a second query

Code:
SELECT Tabelle1.*
FROM Tabelle1 INNER JOIN qryLatest ON Tabelle1.FELD1=qryLatest.FELD1 AND Tabelle1.FELD2=qryLatest.Latest
 
It works perfect! Thank you for your fast answer!

Georg
 
Note that You only need the second query suggested by CJL if you want to include the ID field.
If not, just use the aggregate query.
 
Further to the responses received so far, what exactly identifies a product?
Your
the product and the latest date
is not quite enough info.
Often helpful if you include a sample of your desired output.
Good luck with your project.
 
I'm not sure it did work. Is Field2 an actual Date/Time field? or is it a text field with just a string that represents a date?

What happens when you use this sample data:

ID, Field1, Field2
1, Pen, 10.01.2018
2, Pen, 01.01.2019
 

Users who are viewing this thread

Back
Top Bottom