Ver Mensaje Individual
  #6 (permalink)  
Antiguo 05/12/2008, 08:32
Avatar de Adler
Adler
Colaborador
 
Fecha de Ingreso: diciembre-2006
Mensajes: 4.671
Antigüedad: 18 años, 3 meses
Puntos: 126
Respuesta: Filtrar 6 primeros caracteres

Hola

Prueba así. Se trata de hacer un arreglo

Código asp:
Ver original
  1. SQL = "Select campo From tabla"
  2.  
  3. registros = rs.getrows()
  4. cantidad = CInt(UBound(registros,2) +1)
  5.  
  6. Dim valores()
  7. Redim preserve valores(1)
  8.  
  9. for i = 0  to UBound(registros,2)
  10. valores(0) = Left(registros(0,0),6)
  11.  
  12. resultado=0
  13.        
  14. For y=0 to (UBound(valores)-1)
  15. resultado = StrComp(Left(registros(0,i),6),valores(y),1)
  16.  
  17. if (resultado = 0) Then
  18. Exit For
  19. end if
  20. Next
  21.  
  22. if(resultado <> 0) Then
  23. Redim preserve valores(UBound(valores)+1)
  24. valores(UBound(valores)-1) = Left(registros(0,i),6)
  25. end if
  26. Next
  27.  
  28. For p = 0 to UBound(valores)
  29. Response.Write valores(p) & "<br />"
  30. Next

Suerte
__________________
Los formularios se envían/validan con un botón Submit
<input type="submit" value="Enviar" style="background-color:#0B5795; font:bold 10px verdana; color:#FFF;" />