2014-09-03 59 views
0

我有一个显示查询结果的表格。 该查询具有从表单提交的记录,并且用户选择月份/年份显示的时间和日期 。当记录尚未提交时,在表格中显示文本?

我希望能够在该月份输入特定月份但没有结果时输入 以显示尚未输入结果的文本。

例如:

[月]还没有结果。

monthly_enter_date是它显示结果的日期。

什么是做到这一点的最好方法是什么?

<cfset dtToday = Now() /> 

<table > 
<thead><th>Month</th></thead> 
<cfloop query="getdates"> 

<cfset timesetting = #getdates.monthly_enter_date#> 
    <cfif dtToday gt timesetting> 
<tbody> 
<cfoutput > 
<tr> 
<td><a href="cse_allusers_summary_results.cfm?month=#getdates.month#&year=#getdates.year#"> #MonthAsString(month)# #year#</a></td> 
</tr> 
</cfoutput> 
</cfif> 
</cfloop> 

</td> 
</table> 

回答

2

怎么是这样的:

<cfif getdates.recordcount is 0> 
static text to indicate no data 
<cfelse> 
all that code in your question 
</cfif>