Or you can do it the CF way:

first record:
#myQuery.ColumnName# (outside of a loop)  OR #myQuery.ColumnName[1]#

last record:
#myQuery.ColumnName[myQuery.RecordCount]#

Tyler

----- Original Message -----
From: "Bruce Sorge" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Tuesday, January 21, 2003 11:05 AM
Subject: Re: Selecting First/Last Record in query


For the first:
Select TOP 1 *
>From Table

For the last:
Select MAX (FieldName) AS Alias
>From Table

----- Original Message -----
From: "Thane Sherrington" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Tuesday, January 21, 2003 10:01 AM
Subject: Selecting First/Last Record in query


> How to I get the first or last record in a query?
>
> T
>
>

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Get the mailserver that powers this list at http://www.coolfusion.com

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
                                

Reply via email to