Instead of sending this query again to check the record count :
----------------------
<cfquery name="ownercount"
datasource="#Request.MainDSN#">
SELECT COUNT(*)
FROM HOAS INNER JOIN OWNERS ON HOAS.HOAID = OWNERS.PROJECT
WHERE HOAS.NAME = <cfqueryparam value="#hoa#" > </cfquery>
----------------------
You can use :
-----------------------
<cfif owners.recordcount>
-----------------------
Thanks.
-Sandy Vohra
-----Original Message-----
From: Robert Makowski [mailto:[EMAIL PROTECTED]
Sent: Tuesday, October 17, 2006 2:30 PM
To: CF-Newbie
Subject: RE: multiple cfquery commands on the same page
<cfset hoa="#form.Properties#">
<cfquery name="owners"
datasource="#Request.MainDSN#">
SELECT *
FROM HOAs INNER JOIN owners ON HOAs.hoaID =
owners.project
WHERE HOAS.NAME = <cfqueryparam value="#hoa#" >
</cfquery>
<cfquery name="ownercount"
datasource="#Request.MainDSN#">
SELECT COUNT(*)
FROM HOAS INNER JOIN OWNERS ON HOAS.HOAID = OWNERS.PROJECT
WHERE HOAS.NAME = <cfqueryparam value="#hoa#" >
</cfquery>
<!--<cfdump var="#ownercount#">-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"
/>
<title>HOA Owner Infomation</title>
</head>
<body bgcolor="#000066" text="#FFFFFF">
<center>
<img src="img/prs1.jpg" /><br /><br /><br />
<cfoutput query="ownercount"> //THIS CFOUTPUT IS FOR THE COUNT
<cfif #expr1000# EQUAL 0> //IF ROW COUNT EQUALS 0 ALL FO
There are currenly no owner for this propertyin
the rental program
<br />
<font face="Arial"><b>You will be redirected
back to the main page in<br><br>
<form name="redirect">
<form>
<input type="text" size="3"
name="redirect2">
</form>
seconds</b></font>
</center>
//Javascript for count down and redirect--OMITTED TO SAVE SPACE
<cfelse> //IF THERE ARE ROW TO DISPLAY START HERE
<table border="1" align="center"> //I DON'T WANT THE CFOUTPUT
BEFORE THIS LINE, BECAUSE I DON'T WANT THE COLUMN LABELS TO BE REPEATED
EVERYTIME.
<tr>
<td></td>
<td align="center">Status</td>
<td align="center">Names</td>
<td align="center">Addresses</td>
</tr>
<cfform name="owner_data" method="post"
action="rentalworksheet.cfm">The are the owners at
<cfoutput>#hoa#</cfoutput> are:
<cfoutput query="owners"> //OUTPUT FOR A TABLE FILL
<tr>
<td><input type="radio" name="owners"
value='#OWNERS.OWNERID#' checked/></td>
<td>
<cfif #rentalcanceled#>The owner has
canceled our program
<cfelseif
#occupiedavailable#>Unit is <strong>occupied</strong> and
<strong>available</strong>
<cfelseif #vacentavailable#>Unit
is <strong>vacent</strong> and <strong>available</strong>
<cfelse>There is currently no
status for this unit
</cfif>
</td>
<td>#OWNERS.FIRSTNAME# #OWNERS.LASTNAME#</td>
<td>#OWNERS.STREET# #OWNERS.CTY#, #OWNERS.STATE#
#OWNERS.ZIP#</td>
</tr>
</cfoutput>
</table>
<br />
<input type="submit" />
</cfform>
</cfif>
</cfoutput>
</center>
</body>
</html>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four
times a year.
http://www.fusionauthority.com/quarterly
Archive:
http://www.houseoffusion.com/groups/CF-Newbie/message.cfm/messageid:2146
Subscription: http://www.houseoffusion.com/groups/CF-Newbie/subscribe.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.15