Visual Basic - PROBLEMILLA AL EJECUTAR UNA CONSULTA

Life is soft - evento anual de software empresarial
 
Vista:

PROBLEMILLA AL EJECUTAR UNA CONSULTA

Publicado por juanb (4 intervenciones) el 07/02/2005 11:23:38
HOLA A TODOS, TENGO EL SIGUIENTE PROBLEMA.

TENGO UN FORMULARIO DONDE SE INTRODUCEN DOS FECHAS PARA REALIZAR UNA CONSULTA SOBRE UNA BASE DE DATOS, PERO NO ME REALIZA BIEN LA BUSQUEDA.

LA CONSULTA ES LA SIGUIENTE:

select * from " & cmb_consulta.Text & " where fecha >= " & fecha1 & " and fecha <= " & fecha2 & ""

adodc_consulta.RecordSource = orden
adodc_consulta.Refresh

ESTO ME DA UN ERROR DE SINTAXIS EN LA CLAUSULA FROM.

¿SABEIS A QUE ES DEBIDO?
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

RE:PROBLEMILLA AL EJECUTAR UNA CONSULTA

Publicado por Ricardo (19 intervenciones) el 07/02/2005 16:01:30
creo que te faltaba esto, siempre cuando consultes fechas utiliza el simbolo #.

select * from " & cmb_consulta.Text & " where fecha >= #" & fecha1 & "# and fecha <= #" & fecha2 & "#"
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar