Query Results give Empty Output?
Hello,
I am trying to create a text file from a coldfusion output table. The followng code is returning an empty set, when in fact I know there are records returned. Any insight would be greatly appreciated!
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
</head>
<body>
<CFQUERY name="by_tr" datasource="surveyalpha" dbtype="odbc">
select *
FROM sire.dbo.control_doc
WHERE sire.dbo.control_doc.publish = 'yes' and
sire.dbo.control_doc.township_range like '%#form.text#%'
<CFIF Not IsDefined("#form.field#")>
ORDER BY section
<cfelseif form.field is "section">
ORDER BY section
<cfelseif form.field is "grid_address">
ORDER BY grid_address
<cfelseif form.field is "point_name">
ORDER BY point_name
</cfif>
</CFQUERY>
<cfif by_tr.recordcount greater than 0>
<pre>
Point Name|Northing|Easting|Differential Elevation|RTK Elevation|Monument Type|Monument Description|Grid Address|Township & Range|Section|Latitude|Longitude|Monument Notes
</pre>
<cfoutput query="by_tr">
<pre>
#Point_Name#|#Northing#|#Easting#|#Elevation_Diff#|#elevation_rtk#|#Mon_type#|#Mon_description#|#Grid_Address#|#Township_Range#|#Section#|#Latitude_DMS#|#Longitude_DMS#|#Mon_notes#
</pre>
</cfoutput>
<cfelse>
<pre>
Your search yielded no results.
</pre>
</cfif>
</body>
</html>
