|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| ||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Error with Select Top N Records
I want to select the top 3 records that meet certain criteria. The statement works fine, except when there are less than 3 records that meet the criteria. Then I get an error.
I use GetRows to get the rows and then a For i=0 to ubound, next statement to retrieve the results. Any ideas on how I get around the page throwing an error when there are less than 3 records? |
|
#2
|
||||
|
||||
|
SQL Query
SELECT TOP 3 id, name FROM table WHERE foo = blah CODE Code:
FOR i = 0 to ubound(aryRS,2) ... NEXT |
|
#3
|
|||
|
|||
|
D'oh
forgot to say
ubound(array, 2) instead wrote ubound(array) |
![]() |
| Viewing: Dev Articles Community Forums > Programming > ASP Development > Error with Select Top N Records |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|