I have a conference database with a text field for
time. The times are entered in 12 hour time with am
or pm (ex., 9:00 am or 2:00 pm). Is there a way to
sort this field to list the conferences in order by
time? The problem I see, is 2 comes before 9, so the
above example will list the 2:00 pm time before the
9:00 am time. I'd like to do this without changing
the actual database if possible. The code I use to
list the times is (it displys a table with the current
weeks worth of conferences):
<table><tr>
<CFLOOP from="0" to="4" index="i">
<td align="left" valign="top">
<CFOUTPUT>
<strong>#dateformat(dateadd("d", i, url.startdate),
"ddd, mmm d")#</strong>
</CFOUTPUT><br><hr width="100">
<cfquery name="qGetDates" datasource="teleconference"
dbtype="ODBC" cachedwithin="#CreateTimeSpan("0", "1",
"0", "0")#">
SELECT ID, conf_name, begin_time, conf_date
FROM data
WHERE conf_date = #createodbcdate(dateadd("d", i,
url.startdate))#
ORDER BY begin_time
</cfquery>
<CFLOOP query="qGetDates">
<cfoutput>#qGetDates.begin_time# <A
HREF="conference_schedule_item.cfm?ID=#qGetDates.ID#">#qGetDates.conf_name#</A><br></cfoutput>
</CFLOOP>
</td>
</CFLOOP>
</tr>
</table>
This works, except that the conferences are listed in
the order they are in the database, not time order.
Thanks,
Tim
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists