我有一个查询为什么得到错误元素recordcount是未定义的?
SELECT csedept_name,submitterdept, COUNT(execoffice_status) as 'starsgiven'
FROM Depts d
LEFT JOIN CSEReduxResponses c on d.csedept_id = c.submitterdept
.......
and YEAR ([approveddate]) =2014
and month ([approveddate]) =12
....
,当我在microsolf SQL Server的工作室运行我得到 20行返回,全部用“submitterdept”空。 但我不断收到此错误:
Element RECORDCOUNT is undefined in GETBRANCHSTARS.
The error occurred in stars.cfm: line 498
496 : </cfif>
497 : <cfset totalbranch =0 >
498 : <cfif getbranchstars.recordcount gt 0>
499 :
500 : <h1> Counts </h1
出于某种原因,是不承认的RecordCount。
我做错了什么?
<cfset totalbranch =0 >
<cfif getbranchstars.recordcount gt 0>
<table >
<thead><tr><th>Branch</th><th>Stars Given</th></tr></thead>
<tbody>
<cfoutput query="getbranchstars" >
<tr>
<td>#CSEDEPT_NAME#</td>
<td>#BRANCHTOTALSTARSGIVEN#</td>
</tr>
<cfset totalbranch += BRANCHTOTALSTARSGIVEN>
</cfoutput>
</tbody>
<tfoot>
<cfoutput>
<tr>
<th> </th>
<th><div align="left">#totalbranch#</div></th>
</tr>
</cfoutput>
</tfoot>
</table>
<cfelse>
<p>No Branch Department Counts</p>
</cfif>
请将您的cfquery标签或新查询()方法添加到您的示例中...问题可能存在 – 2014-12-02 22:23:24
同意,显示更多代码。此外,请检查查询周围的任何条件语句是否可能阻止其在某些条件下运行,这意味着getbranchstars查询变量甚至可能不会被定义。 – 2014-12-02 22:53:00
我看到我能做什么,事情是如果我将查询中的月份更改为11,它的效果很好 – jfishbow 2014-12-02 22:58:24