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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Pound sign Problem..?!?

Status
Not open for further replies.

micjohnson

Programmer
Nov 9, 2000
86
US
Hi there!

Here is my code.


<CFIF Departure IS &quot;Y&quot;>
<CFSET Query_Name = &quot;Student_Departure&quot;>
<CFELSE>
<CFSET Query_Name = &quot;Student_Attendance&quot;>
</CFIF>

<CFOUTPUT>
<CFQUERY name=&quot;#Query_Name#&quot; datasource=&quot;DSNname&quot;
dbtype=&quot;ODBC&quot;>

SELECT *
FROM Tablename
WHERE School_Name='#School_Name#'
ORDER BY Last_Name, First_Name
</CFQUERY>


<CFIF ##Query_Name#.RecordCount# IS '0'>

<font color=blue><b>No Records found !/b></font>
<a href=&quot;Select_School.cfm?
Group=Staff&Departure=Y&quot;>Return Back</a>
<CFABORT>

</CFIF>

</CFOUTPUT>

otherwise continue
...
...

If Departure is &quot;Y&quot;, the Query name should become &quot;Student_Departure&quot;. It is OK and the query is working fine. But the problem is when i want to check the record count, it shows the error.

The error line is,

<CFIF ##Query_Name#.RecordCount# IS '0'>

I thing it may be a pound sign problem. But i can't rectify it. I need the help plse....

Thanx in Advance!!

micjohnson

 
HEY micjohnson,

The problem is with this line:

<CFIF ##Query_Name#.RecordCount# IS '0'>


This will work:

<CFSET question=&quot;#Query_Name#.recordcount&quot;>
<CFIF #Evaluate(question)# IS '0'>

Hope this cures it. Have fun...
 
Hi tlhawkins !

Thanx Lot! Its Workout.

Thanx again

micjohnson
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top