distinct month AND year

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
 
G

Guest

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

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top