I am pulling dates from my database using this code:

<%
Set rs = Server.CreateObject("adodb.recordset")
cmdTemp.CommandText = "SELECT First, Last, Anniversary, Ext FROM Directory " _
      & " WHERE Month(Anniversary) = " & showMonth _
      & " ORDER BY Anniversary"
rs.Open cmdTemp, , AdOpenStatic 

Do Until RS.EOF
    AnnName = RS("First") & " " & RS("Last")
    ADt = RS("Anniversary")
    ' formatting ADt, don't like the default format
    ADt = MonthName(Month(ADt), True) & " " & Day(ADt) & ", " & Year(ADt)
    Ext = RS("Ext")

%>

I get the dates shown as such:

Jan 3, 1989
Jan 1, 1995
Jan 15, 1996
Jan 5, 1998
Jan 4, 1999
Jan 25, 1999
Jan 3, 2000
Jan 17, 2000
Jan 17, 2000
Jan 24, 2000
Jan 24, 2000
Jan 26, 2000
Jan 8, 2001
Jan 22, 2001

How can I get it to use the DAY instead of the YEAR?

Thanks in advance
Jackie

Thanks, Thirusha.

I ended up using:

ORDER BY Day(Anniversary), Year(Anniversary)

And that did what I needed.

This question has already been answered. Start a new discussion instead.