Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - how to select 2 up and 2 down
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

how to select 2 up and 2 down

 Post Reply Post Reply Page  12>
Author
asp what that?? View Drop Down
Mod Builder Group
Mod Builder Group


Joined: 08 November 2003
Location: United States
Status: Offline
Points: 140
Post Options Post Options   Thanks (0) Thanks(0)   Quote asp what that?? Quote  Post ReplyReply Direct Link To This Post Topic: how to select 2 up and 2 down
    Posted: 01 October 2004 at 12:57pm

what i am trying to do is slect 2 up and 2 down from a table

say this is the info in my table

1   doug   $111
2   doug   $111
3   doug   $111
4   doug   $111
5   doug   $111
6   doug   $111
7   doug   $111

what i want to do select the records that are 2 up and to down from the red

Quote

strSQL = "SELECT TOP 6 * FROM tblAuthor WHERE  Author_ID <> all ( SELECT Top 5 Author_ID FROM tblAuthor Order By Cash desc)Order By Cash desc;"

this will select the top 5 and take them out and will leave me with the top 6 of what is left.

what i need to figure out is how to tell me what the number is for the record so i can changed the TOP (x) numbers so that i can get the top 2 and bottom 2 from a member...any ideas?

Back to Top
theSCIENTIST View Drop Down
Senior Member
Senior Member


Joined: 31 July 2003
Location: United Kingdom
Status: Offline
Points: 440
Post Options Post Options   Thanks (0) Thanks(0)   Quote theSCIENTIST Quote  Post ReplyReply Direct Link To This Post Posted: 03 October 2004 at 7:31pm
Humm, I think what you need is this:

rsRecSet.RecordCount
This gives you the number of records your query returned.

rsRecSet.AbsolutePosition
This tells you when you are looping through the recorset which record is being processed at that moment, with this you can do what's needed.
Back to Top
asp what that?? View Drop Down
Mod Builder Group
Mod Builder Group


Joined: 08 November 2003
Location: United States
Status: Offline
Points: 140
Post Options Post Options   Thanks (0) Thanks(0)   Quote asp what that?? Quote  Post ReplyReply Direct Link To This Post Posted: 03 October 2004 at 7:54pm
let me try that..TY
Back to Top
asp what that?? View Drop Down
Mod Builder Group
Mod Builder Group


Joined: 08 November 2003
Location: United States
Status: Offline
Points: 140
Post Options Post Options   Thanks (0) Thanks(0)   Quote asp what that?? Quote  Post ReplyReply Direct Link To This Post Posted: 03 October 2004 at 7:58pm
could u give me a small example of how this woudl work
Back to Top
theSCIENTIST View Drop Down
Senior Member
Senior Member


Joined: 31 July 2003
Location: United Kingdom
Status: Offline
Points: 440
Post Options Post Options   Thanks (0) Thanks(0)   Quote theSCIENTIST Quote  Post ReplyReply Direct Link To This Post Posted: 03 October 2004 at 10:05pm
I don't understand very well what you are trying to accomplish, please elaborate.
Back to Top
asp what that?? View Drop Down
Mod Builder Group
Mod Builder Group


Joined: 08 November 2003
Location: United States
Status: Offline
Points: 140
Post Options Post Options   Thanks (0) Thanks(0)   Quote asp what that?? Quote  Post ReplyReply Direct Link To This Post Posted: 03 October 2004 at 10:40pm

OK...this is what my db looks like

what i need to do is select the top 5 records order by cash

and that will be the top 5 players and that will be in one table on the site

now what i need to do is.... say your ID is 29

what i want to do is select X about up and X about down we will just say 2 up and 2 down  for a total of 5 for now

like this...

what is it is i am trying to do is have 2 tables on the site

the first table will be the top 5 players

the second table will be a group of 5 to 10 players that you fall in with....order by Cash..but you need to be the center of the second table...how that helps out a little bit

Back to Top
Phat View Drop Down
Senior Member
Senior Member


Joined: 23 February 2003
Status: Offline
Points: 386
Post Options Post Options   Thanks (0) Thanks(0)   Quote Phat Quote  Post ReplyReply Direct Link To This Post Posted: 04 October 2004 at 6:27am
Use rs.Move 2 and then rs.move -2
Back to Top
asp what that?? View Drop Down
Mod Builder Group
Mod Builder Group


Joined: 08 November 2003
Location: United States
Status: Offline
Points: 140
Post Options Post Options   Thanks (0) Thanks(0)   Quote asp what that?? Quote  Post ReplyReply Direct Link To This Post Posted: 04 October 2004 at 8:51am
could u show me a small example for me to work off from?
Back to Top
 Post Reply Post Reply Page  12>

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.