Gary, isn't there a qQuery.currentRow attribute as well so

qQuery.currentRow + 1 and qQuery.currentRow - 1 might be possible?

(can't test it ATM)

just a thought
barry.b


-----Original Message-----
From: Gary Menzel [mailto:[EMAIL PROTECTED] 
Sent: Friday, 26 March 2004 3:11 PM
To: CFAussie Mailing List
Subject: [cfaussie] Re: SQL SELECT

> Is there a quick (and clean or dirty) way of finding the previous and 
next
> record from a database? I would just use the auto increment to do it, 
but I
> am not willing to trust that records won't get deleted. And I didn't 
want to
> grab the whole table and process it.

Not in the way in which you may use that type of functionality in 
something like DBase.

<CFOUTPUT> has STARTROW and MAXROWS that can be used when outputting 
<CFQUERY> data.  You can use this to page groups of records (the group -

MAXROWS - can be 1).

Another member of this list also theoretically demonstrated how queries 
could be constructed to only return the number of records you wanted
from 
the point you wanted them (search the archive for this) but I was not
able 
to get the method to work effectively (so it may not work across all SQL

databases) - and there was some question as to the performance of the 
nested queries that were being used.

Working out PREVIOUS would be a matter of remembering where you are up
to 
in the record set.

NEXT would be remembering where you are up to and just setting STARTROW
to 
be one more than where you are.


QUESTION: what are you actually trying to do?  (sometimes it is better
to 
describe what you are trying to achieve and then the group is better
able 
to provide CF/MX best practice).



Gary Menzel
Web Development Manager
IT Operations Brisbane -+- ABN AMRO Morgans Limited
Level 29, 123 Eagle Street BRISBANE QLD 4000
PH: 07 333 44 828  FX:  07 3834 0828



If this communication is not intended for you and you are not an
authorised recipient of this email you are prohibited by law from
dealing with or relying on the email or any file attachments. This
prohibition includes reading, printing, copying, re-transmitting,
disseminating, storing or in any other way dealing or acting in reliance
on the information.  If you have received this email in error, we
request you contact ABN AMRO Morgans Limited immediately by returning
the email to [EMAIL PROTECTED] and destroy the original. We
will refund any reasonable costs associated with notifying ABN AMRO
Morgans. This email is confidential and may contain privileged client
information. ABN AMRO Morgans has taken reasonable steps to ensure the
accuracy and integrity of all its communications, including electronic
communications, but accepts no liability for materials transmitted.
Materials may also be transmitted without the knowledge of ABN AMRO
Morgans.  ABN AMRO Morgans Limited its directors and employees do not
accept liability for the results of any actions taken or not on the
basis of the information in this report. ABN AMRO Morgans Limited and
its associates hold or may hold securities in the companies/trusts
mentioned herein.  Any recommendation is made on the basis of our
research of the investment and may not suit the specific requirements of
clients.  Assessments of suitability to an individual?s portfolio can
only be made after an examination of the particular client?s
investments, financial circumstances and requirements.
ABN AMRO Morgans Limited (ABN 49 010 669 726 AFSL 235410) A Participant
of ASX Group


---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to
[EMAIL PROTECTED]

MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia
http://www.mxdu.com/ + 24-25 February, 2004


---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]

MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia
http://www.mxdu.com/ + 24-25 February, 2004

Reply via email to