distinct month AND year

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

if i have a table like this:

4/3/2006
4/3/2007
4/12/2006
4/12/2008
5/2/2003
5/5/2003

i would like to extract only the distinct month and year date, so my query
should return

4/12/2006
4/3/2007
4/12/2008
5/5/2003


can anyone plz help me with the sql query? thanks
 
Try this --
SELECT Max(iori.Field1) AS MaxOfField1
FROM iori
GROUP BY Format([Field1],"yyyymm")
ORDER BY Format([Field1],"yyyymm");
 
thanks Karl that works for me :)

KARL DEWEY said:
Try this --
SELECT Max(iori.Field1) AS MaxOfField1
FROM iori
GROUP BY Format([Field1],"yyyymm")
ORDER BY Format([Field1],"yyyymm");


iori said:
if i have a table like this:

4/3/2006
4/3/2007
4/12/2006
4/12/2008
5/2/2003
5/5/2003

i would like to extract only the distinct month and year date, so my query
should return

4/12/2006
4/3/2007
4/12/2008
5/5/2003


can anyone plz help me with the sql query? thanks
 
Back
Top