CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> ASP

 Show a record, the next and the previous

Print topic Send  topic

Author Message
Alfons
Posted: 08/10/2004, 11:36 AM

I want to know how to show a record after search it and the next and the previous of that record.

For example, a table with 20 records. If record 17 is "Numancia" in the field 'name', then I want to show records 16, 17 and 18.

Can anybody help me?

Thanks
DonB
Posted: 09/05/2004, 8:04 PM

Querying for

SELECT * from table WHERE primarykey between
(SELECT MAX(primarykey) FROM table where primarykey < middlevalue) AND
(SELECT MIN(primarykey) FROM table where primarykey > middlevalue)
;

is (barring any syntactic errors I might have made) one solution. The
"middlevalue" is "17" in your example.

--
DonB

http://www.gotodon.com/ccbth


"Alfons" <Alfons@forum.codecharge> wrote in message
news:6411915c46d1d1@news.codecharge.com...
> I want to know how to show a record after search it and the next and the
> previous of that record.
>
> For example, a table with 20 records. If record 17 is "Numancia" in the
field
> 'name', then I want to show records 16, 17 and 18.
>
> Can anybody help me?
>
> Thanks
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>


Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

PHP Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.