Set maxrows to 1
----- Original Message -----
From: "John Cowie" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Monday, January 08, 2001 1:59 PM
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/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to