<cfloop query="queryname">
 <cfif CurrentRow eq 1>
  ...display content
 <cfelse>
  <cfbreak>
 </cfif>
</cfloop>

Or you could just do this:-)

<cfoutput query="queryname" startrow=1 maxrows=1>
 ...display content
</cfoutput>



-----Original Message-----
From: Michael Gribbin [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, 20 March 2001 2:10 PM
To: CF-Talk
Subject: One record query output


Hi, I'm trying to find out if it's possible to limit the output of a query
to one record. I have a database that is sorted in decending order and I
only want the top record (the one with the biggest total) to display. I can
do a work-a-round by setting a variable to "on" before the query output and
turning it "off" after the first record is processed and then <cfif>
skipping the rest of the records, but was hoping to do it in the query it's
self.

Possible?

Thanks in advance.

Michael Gribbin
Digital Marketing Alliance
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to