You are correct that it should work, but they maybe something else in the
code which is preventing the query from being executed. On the top of your
page add:

        <cfparam name=" blahName.recordcount" default="0">
 
And that will deal with the case where the query is not executed.

Robert B. Harrison
Director of Interactive Services
Austin & Williams
125 Kennedy Drive, Suite 100 
Hauppauge NY 11788
P : 631.231.6600 Ext. 119 
F : 631.434.7022
http://www.austin-williams.com 

Great advertising can't be either/or.  It must be &.

Plug in to our blog: A&W Unplugged
http://www.austin-williams.com/unplugged


-----Original Message-----
From: Dave Sueltenfuss [mailto:dsueltenf...@gmail.com] 
Sent: Wednesday, March 31, 2010 1:59 PM
To: cf-talk
Subject: CFQUERY Question


I'm running into an odd behavior with CFQUERY (at least I think it is odd)

I have the following code (example)

<cfquery name="blahName" datasource="blah">
   SELECT blah
     FROM blah
   WHERE blah = 1
</cfquery>

<CFIF blahName.recordCount GT 0>
   12345
</CFIF>

if the query blahName returns no results, I thought i would still be able to
access blahName.recordCount....

Am I wrong on this, or is there something else I am overlooking?

Thanks
-Dave




~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:332501
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to