Ver Mensaje Individual
  #2 (permalink)  
Antiguo 01/07/2010, 01:27
Insomnia
 
Fecha de Ingreso: noviembre-2005
Mensajes: 751
Antigüedad: 18 años, 6 meses
Puntos: 13
Respuesta: tengo problemas me podrian ayudar

Hola

No hace falta que repitas toda la consulta cada vez, con añadir solo el orden es suficiente:

Código vb:
Ver original
  1. strSQL = "SELECT PrecioDetal * 1.12 AS PVP, tblProduct.CodRef, tblProduct.Descripcion, " & _
  2. "tblProduct.Marca, tblExistencia.Existencia, tblProduct.IDUnidC , tblExistencia.Observaciones " & _
  3. "FROM tblProduct " & _
  4. "INNER JOIN tblExistencia ON tblProduct.CodRef = tblExistencia.CodRef " & _
  5. "WHERE (Descripcion LIKE '%" & strDescripcion & "%' ) AND (Marca LIKE '%" & strMarca & "%') AND " & _
  6. "(tblProduct.CodRef LIKE '%" & strCodigo & "%') AND (Observaciones LIKE '%" & strReferencia & "%') " & _
  7. "AND ((PrecioDetal * 1.12) BETWEEN " & sngPVPdesde & " AND " & sngPVPhasta & ") "
  8. "ORDER BY"
  9.  
  10. If OptCodigo.Value = True Then
  11.    strSQL = strSQL & " tblProduct.CodRef"
  12. end if
  13. If optDescripcicion.value=true then
  14.    strSQL = strSQL & " tblProduct.CodDes"
  15. end if
  16. ...

--Saludos--