You should use ORDER BY to assure that you're getting the top three.
Because you enter new records does not make those records "top" records.
Try ordering by your priary key (descending) if it's an identity element, or
timestamp the insert and order on that (descending).


Kevin Langevin
Flying Chimp Media
954-585-0999
[EMAIL PROTECTED]
http://www.FlyingChimp.com

> -----Original Message-----
> From: W Luke [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, February 13, 2002 10:23 AM
> To: CF-Talk
> Subject: TOP 3 not working, again
>
>
> Why does TOP rarely work for me?  I just need to grab the last 3 records,
> but instead it pulls the same 3 each time, regardless of whether there are
> newly inserted records or not
>
>  <Cfquery name="latestphotos" maxrows=3 datasource="#ds#">
>  SELECT TOP 3 ID, left(description, 15) as NewDescrip, * FROM
> thumbNailElements
>  </CFQUERY>
>
> Any ideas?
>
> Thanks
>
> Will
>
>
> ---
> "A woman drove me to drink and I didn't even have the decency to thank
> her." --W.C. Fields
>
> 
______________________________________________________________________
Dedicated Windows 2000 Server
  PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER
  Instant Activation · $99/Month · Free Setup
  http://www.pennyhost.com/redirect.cfm?adcode=coldfusiona
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to