Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Date Searching 1

Status
Not open for further replies.

peter11

Instructor
Mar 16, 2001
334
0
0
US
Does anyone know what is wrong with the code below.
The date entered on the form is 11/11/01.
The database shed_date is set to Short Date.

<CFQUERY DATASOURCE=&quot;sports&quot; NAME=&quot;schedule&quot;>
SELECT *
FROM opponent, schedule, team
WHERE team.ID = schedule.SportID AND
opponent.oppID = schedule.OpponentID and
schedule.sched_date = #form.sched_date1#

ORDER BY sched_Date
</CFQUERY>
<HTML>
<HEAD>
<TITLE>Date Search</TITLE>
</HEAD>
<BODY>

<TABLE BORDER=5>


<TR><cfoutput query=&quot;schedule&quot;>
<TD valign=&quot;top&quot; align=&quot;left&quot;><font size=&quot;2&quot; face=&quot;Arial, Helvetica, sans-serif&quot;><cfif timeformat(sched_date,&quot;HH:mm&quot;) eq &quot;00:00&quot;>TBA<cfelse>#timeformat(sched_date,&quot;h:mm&quot;)#</cfif></font>
</TD>
<TD valign=&quot;top&quot; align=&quot;left&quot;><font size=&quot;2&quot; face=&quot;Arial, Helvetica, sans-serif&quot;>#teamname#</font>
</TD>
<TD valign=&quot;top&quot; align=&quot;left&quot;><font size=&quot;2&quot; face=&quot;Arial, Helvetica, sans-serif&quot;>#dateformat(sched_date,&quot;DDDD&quot;)#</font>
</TD>
<TD valign=&quot;top&quot; align=&quot;left&quot;><font size=&quot;2&quot; face=&quot;Arial, Helvetica, sans-serif&quot;>#dateformat(sched_date,&quot;mm/dd/yy&quot;)#</font>
</TD>

<TD valign=&quot;top&quot; align=&quot;left&quot;><font size=&quot;2&quot; face=&quot;Arial, Helvetica, sans-serif&quot;>#Site#</font>
</TD>
<TD valign=&quot;top&quot; align=&quot;left&quot;><font size=&quot;2&quot; face=&quot;Arial, Helvetica, sans-serif&quot;><cfif #Site# IS &quot;Away&quot;><a href=&quot;link.cfm?id=#opponentID#&quot; target=&quot;_blank&quot;>#OpponentName#</a>
<cfelse>
#OpponentName#
</cfif></font>
</TD>
</TR></cfoutput>

</TABLE>
</BODY>
</HTML>
 

ORDER BY schedule.sched_Date

Sylvano
dsylvano@hotmail.com
 
I still get a blank page. No Cold Fusion error, justa blank page. I don't get it.
 
A blank page would indicate no rows, so if still in dev and you have access to Administrator, trying turning on &quot;Show query information &quot; in debugging. This will let you know whether your query is returning anything, as it may be a join prob if not.

If rowcount is > 0, then your problem may be with logic not query.
 
If schedule.sched_date is a Date or Date/Time field in the database then the code needs to format the date so the db can recognize it as a date using CreateODBCDate() or CreateODBCDateTime() function:

schedule.sched_date = #CreateODBCDate(form.sched_date1)# - tleish
 
That was it, thanks tleish.

Peter
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top