BAH, you don't need to specify a date it was entered in the first place
(unless u need it for some other reason).  just make sure you have some kind
of AUTO ID or increment for each record (u should anyways).  and in your
query, let it select the record with the highest Auto number (which is
always the record most recently entered, i hope).




-----Original Message-----
From: John Cowie [mailto:[EMAIL PROTECTED]]
Sent: Monday, January 08, 2001 2: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/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to