MySQL Forums
Forum List  »  General

Re: SELECT DISTINCT For Month and Year?
Posted by: James Maxon
Date: February 11, 2005 10:15AM

Thank you for your help, I know all the books I looked at for MySQL are PHP. I suppose that is because ASP coders generally use SQL or Access. My problem is Access is limited and SQL costs too much so I am trying the MySQL thing.

This is the basic form of my code:

---------------
<%
DIM mySQL
mySQL = "SELECT DATE_FORMAT(DateEntered, '%M %Y') as mon_yr FROM Y4K GROUP BY mon_yr;"

DIM objRS
Set objRS = Server.CreateObject("ADODB.Recordset")
objRS.Open mySQL, objConn
%>

<html>

<body>

<% Response.Write objRS("mon_yr")%>

</body>

<%
objRS.Close
Set objRS = Nothing
objConn.Close
Set objConn = Nothing
%>

</html>
---------------

I cannot seem to call other fields on my database, but I can call the calculated field "mom_yr".

But the only results I see on the page when executing is "??????4"

So I'm not sure what I'm doing wrong.

Thanks again!
- James

Options: ReplyQuote


Subject
Written By
Posted
Re: SELECT DISTINCT For Month and Year?
February 11, 2005 10:15AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.