Ver Mensaje Individual
  #5 (permalink)  
Antiguo 08/07/2002, 14:18
dagui
 
Fecha de Ingreso: julio-2002
Mensajes: 219
Antigüedad: 22 años, 10 meses
Puntos: 0
Re: Select con variables como campos

A mi me han tocado dos casos hasta ahora.

strSQL = "SELECT * FROM Respuesta WHERE IdRespuesta = "&Cint(rId)

AQUÍ LA VARIABLE ES rId, Y COMO QUIERO COMPARARLA CONTRA UN NÚMERO LE HAGO Cint PARA CONVERTIRLO, YA QUE ASP TOMA LAS VARIABLES COMO STRING POR DEFECTO.

Otro caso que me ha tocado, es este:

strSQL = "delete from MisSoluciones where IdSolucion not in (select IdSolucion from MisSoluciones where IdRespuesta = "&Cint(rId)&")"

DONDE SI CIERRO EL & Y LAS COMILLAS PORQUE TENGO ALGO DESPUES DE LA VARIABLE.

En tu caso yo probaría con uan de estas tres en ese mismo orden:

sql = "select "& a &" from Tabla1 where "& a &" like "& b &

sql = "select "& a &" from Tabla1 where "& a &" like "& b &"

sql = "select "& a &" from Tabla1 where "& a &" like "& b &""