Visual Basic - busqueda QSL

Life is soft - evento anual de software empresarial
 
Vista:

busqueda QSL

Publicado por fernando (40 intervenciones) el 04/09/2013 21:16:08
HOLA QUE ESTOY HACIENDO MAL EN ESTA BUSQUEDA YO QUIERO BUSCAR EN UNA BASE DE DATOS LLAMADA CORRIENTE EN LA COLUNNA FECHA TODOS LOS REGISTROS CON AÑO QUE YO META EN UN CONTROL TEXT1

EN UN CONTROL TEXT YO METO UNA FECHA EJ:12/02/2008 YO QUIERO BUSCAR TODOS LOS REGISTROS DEL 2008

MI SENTENCIA ES :
Data1.RecordSource = "SELECT * FROM corriente WHERE fecha like '" & Format(CDate(Text1.Text), "yyyy") & "*'"
'Data1.Refresh
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
Imágen de perfil de Antoni Masana
Val: 1.259
Plata
Ha mantenido su posición en Visual Basic (en relación al último mes)
Gráfica de Visual Basic

busqueda QSL

Publicado por Antoni Masana (557 intervenciones) el 11/09/2013 09:28:32
No domino el SQL, pero por lo que se esto deberia ser asi:

1
2
3
4
5
Data1.RecordSource = "SELECT *
                      FROM corriente 
                      WHERE year(fecha) like  Format(CDate(Text1.Text), "yyyy")
                     "
Data1.Refresh


O esto

1
2
3
4
5
Data1.RecordSource = "SELECT *
                      FROM corriente
                      WHERE year(fecha)=Format(CDate(Text1.Text), "yyyy")
                     "
Data1.Refresh
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