MySQL Forums
Forum List  »  General

Re: SELECT DISTINCT For Month and Year?
Posted by: James Maxon
Date: February 16, 2005 05:00PM

Thanks, but I still have the same issue. I now think the problem is with the ASP. I ran they query in the MySQL Control Center and it worked. But when I call the query in ASP it gives me the question marks as the output. Any ASPers here that know what the issue is? Is there another way other than asp to display the query on the page? (without losing the .asp page extension of course).

Here is my code:

-----------
<%
DIM objConn
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.ConnectionString = "DSN=MySQL_dsn"
objConn.Open

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>

<% DO WHILE NOT objRS.EOF %>

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

<%
objRS.MoveNext
Loop
%>

</body>
<%
objRS.Close
Set objRS = Nothing
objConn.Close
Set objConn = Nothing
%>
-----------

Thanks,
- James

Options: ReplyQuote


Subject
Written By
Posted
Re: SELECT DISTINCT For Month and Year?
February 16, 2005 05:00PM


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.