Need help with ORDER BY statement
I need your expert help with this, im trying to sort the following by "Date" ive tried adding code here and there but nothing seems to work! the code below works fine and extracts data from the database but I can't see to get it to output by date order. This is connected to a MS Access database and the date format is short date format (dd/mm/yyyy). Im sure its pretty simple to do but I am new to ASP so please help me!
<%
Dim DBConn
Dim sDBString
sDBString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & server.mappath("chamber.mdb") & ";"
set DBConn = Server.CreateObject("ADODB.Connection")
'' Note: Open the database
DBConn.Open(sDBString)
SQLQuery = "SELECT * FROM Events"
Set DBOutput = DBConn.Execute(SQLQuery)
%>
<body text="#000000">
<p><font color="#FFFFFF">
<%Do While Not DBOutput.Eof%>
</font></p>
<p> </p>
<p><%=DBOutput("Date")%></p>
<p><%=DBOutput("Event")%></p>
<p>
<%=DBOutput("Time_held")%></p>
<p><%=DBOutput("Members_price")%></p>
<p>
<%=DBOutput("Non_members_price")%></p>
<p><%=DBOutput("Address")%></p>
<p>
<%=DBOutput("Speaker")%></p>
<p> </p>
<p> </p>
<p><font color="#FFFFFF">
<%
DBOutput.Movenext
Loop
DBConn.Close
Set DBOutput = Nothing
Set DBConn = Nothing
%>
</font> </p>
</body>
</html>
|