<cfquery name="OutputUnitContent" datasource="camp" dbtype="ODBC"
maxrows="1">
Select *
from UnitPages
where ArticleUnit = '#form.units#'
order by ArticleDate DESC
</cfquery>
~Simon
> Simon Horwith
> Allaire Certified ColdFusion Instructor
> Certified ColdFusion Developer
> Fig Leaf Software
> 1400 16th St NW, # 220
> Washington DC 20036
> 202.797.6570 (direct line)
> www.figleaf.com
>
-----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/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists