In the cfoutput tag you can specify the maximum number of rows to show --
also if you use cfoufput without a query attribute, it will only output the
first row.

Lisa Haas
The Kennedy Center

-----Original Message-----
From: John Cowie [mailto:[EMAIL PROTECTED]]
Sent: Monday, January 08, 2001 3:00 PM
To: CF-Talk
Subject: <cfquery>


Hello everyone.  I am running into a problem with my cfquery tag and I
was wondering if anyone out there could give me a hand with this.
Basically I am querying a database that has a series of records.  But
when I output the information from the database I only want to select
the newest record that was entered.  I have a field in the database that
keeps track of the time and date of the information entered.  

Here is the query statement that I am using.  I am able to sort the
content depending on the date but it still spits out all of the records
instead of just the "newest" one.

<cfquery name="OutputUnitContent" datasource="camp" dbtype="ODBC">
Select *
from UnitPages
where ArticleUnit = '#form.units#' 
order by ArticleDate DESC 
</cfquery>


If anyone has an idea how to do this I would really appreciate your
help.

Thanks in advance

John
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to