Hi Everybody,
I have the following table :
Table: tbl_Global
Id CountryId CountyName CountryDate
__________________________________________________ ___
1 1 United Kingdom 13.03.2014
2 1 United Kingdom 02.03.2011
3 1 United Kingdom 03.04.2010
4 2 France 01.02.2012
5 2 France 03.03.2014
6 2 France 09.09.2010
7 2 France 08.04.2008
8 3 Swizterland 09.08.2009
9 4 Belgium 15.12.2013
10 4 Belgium 11.08.2011
11 5 Spain 23.08.2011
12 5 Spain 25.04.2014
I have a problem with the function DMax.
I would like to obtain a query with one record by country with the more recent date (see following query result)
My function in the sql_Global: Result: DMax("CountryDate","tbl_Global","CountryId")
Query: sql_Global
Id CountryId CountryName CountryDate
__________________________________________________ ___
1 1 United Kingdom 13.03.2014
5 2 France 03.03.2014
8 3 Swizterland 09.08.2009
9 4 Belgium 15.12.2013
12 5 Spain 25.04.2014
and the result is the following:
Id CountryId CountryName CountryDate
__________________________________________________ ___
1 1 United Kingdom 25.04.2014
2 1 United Kingdom 25.04.2014
3 1 United Kingdom 25.04.2014
4 2 France 25.04.2014
5 2 France 25.04.2014
6 2 France 25.04.2014
7 2 France 25.04.2014
8 3 Swizterland 25.04.2014
9 4 Belgium 25.04.2014
10 4 Belgium 25.04.2014
11 5 Spain 25.04.2014
12 5 Spain 25.04.2014
Thank you very much for your help.
Best Regards,
Xavier