Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
lane0618
Posting Yak Master
134 Posts |
Posted - 2003-06-25 : 11:23:39
|
| How can a split a table into thirds?Something following this logic:select top(0%-33%) *from awarddetailsselect top(34%-66%) *from awarddetailsselect top(67%-100%) *from awarddetailsThanks!Lane |
|
|
setbasedisthetruepath
Used SQL Salesman
992 Posts |
Posted - 2003-06-25 : 12:00:03
|
| More generally, you're asking about paging. There are lots of articles on SQLTeam that describe various techniques for it.Jonathan{0} |
 |
|
|
lane0618
Posting Yak Master
134 Posts |
Posted - 2003-06-25 : 13:02:24
|
| I'm not trying to page through a recorset. I need to divide an entrire recordset up and display it in three differnt columns in an ASP page. Whats the best way to do this?Thanks |
 |
|
|
Page47
Master Smack Fu Yak Hacker
2878 Posts |
Posted - 2003-06-25 : 13:15:32
|
quote: I need to ... display it in three differnt columns in an ASP page. Whats the best way to do this?
The best way to do this in on the display layer (ASP).If you can't, then do a search on paging and use the various techniques to return the three rowsets. I understand you are not 'paging' but the technique is applicable.Jay White{0} |
 |
|
|
jsmith8858
Dr. Cross Join
7423 Posts |
Posted - 2003-06-25 : 17:10:55
|
| I would use the getrows() method of an ado recordset to fill up an array.set N = size of array = # of rows returnedN/3 = size of each columnthen just do something like this in your asp page:<TABLE> <COL><COL><COL><TR> <TD> -- print the first n/3 elements of your array </TD> <TD> -- print the next n/3 elements of your array </TD> <TD> -- print final n/3 elements </TD></TR></TABLE>keep it simple ... don't return 3 recordsets or force SQL to do something it's not good at (i.e., paging). ASP is really good at doing this kind of stuff -- better than most report writing software, actually.let me know if you have any problems or need more details...- JeffEdited by - jsmith8858 on 06/25/2003 18:43:19 |
 |
|
|
|
|
|