Empty RecordSet and RecordCount

Posted on 2005-03-16
Medium Priority
Last Modified: 2013-12-24
I'm trying to figure something out here...

<cfquery name=myquery>
select *
from table
where empid = ...

<cfif myquery.recordcount GT 0>
Put data here
There is no data found.

If the query returns the empty recordset the cfif statement doesn't recognize any recordcount so the result ends up just being blank.  I want the result to be if the query returns an empty recordset, to say that there are no records.  What am I missing?
Question by:Lee R Liddick Jr
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Expert Comment

ID: 13557380
It should be working as it is.

Author Comment

by:Lee R Liddick Jr
ID: 13557433
it is not...when the query comes back with nothing, the page shows nothing.
LVL 25

Accepted Solution

James Rodgers earned 400 total points
ID: 13557474
i use this synatax

<cfif getComments.recordCount NEQ 0>

always works for me...
Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

LVL 21

Expert Comment

ID: 13557516
Hi leerljr68,
it may be possible that the query has null value and returning you the one record with empty cells or null values.
otherwise syntax is fine.

LVL 36

Expert Comment

ID: 13557768
simple way of checking is


Author Comment

by:Lee R Liddick Jr
ID: 13557868
That did it jester!  Once again...thank you.
LVL 25

Expert Comment

by:James Rodgers
ID: 13558907
glad i could help

thanks for the points

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In our day to day coding, how many times have we come across a necessity to check whether a URL is a broken link or not? For those of you that answered countless and are using ColdFusion like myself, then this article is for you.  It will show yo…
One of the typical problems I have experienced is when you have to move a web server from one hosting site to another. You normally prepare all on the new host, transfer the site, change DNS and cross your fingers hoping all will be ok on new server…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question