Copy link to clipboard
Copied
This question was posted in response to the following article: http://help.adobe.com/en_US/ColdFusion/9.0/CFMLRef/WSc3ff6d0ea77859461172e0811cbec22c24-7fa9.html
Copy link to clipboard
Copied
IsQuery will return true even if there are zero records in the record count.
Copy link to clipboard
Copied
Yes, all IsQuery does is check to see if the object is a query, or not (boolean). Even if there are no records returned, a query is still a query.
If you want to check to see if a query has more than 0 records in it, use <cfif queryName.recordCount gt 0></cfif>
^_^
Copy link to clipboard
Copied
mrs_temple wrote:
IsQuery will return true even if there are zero records in the record count.
It is not the records which make a query a query. It is the two-dimenstional structure which ColdFusion creates to hold the records. To compare, an empty HTML table is still a a table.
Use the test:
if isQuery(myQuery) and myQuery.recordcount gt 0