Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hola a todos. Necesito su ayuda. Tengo problemas para definir un intervalo de fecha en el script. La base de la que estoy levandando la información es de Visual Fox. La idea es que de la tabla h_detmov solo cargue los datos que sean de una fecha inferior a 01/06/2010. El Campo fecha forma parte de la tabla.
LOAD codunico,
fecha,
pu,
codmon,
dto,
codgrupo;
SQL SELECT *
FROM `h_detmov` where fecha < '01/06/2010';
pero intente me salta el error:
Error de SQL:Operator/operand type mismatch.
Línea de Script:SELECT * FROM `h_detmov` where fecha < 01/06/2010
SQL SELECT *
FROM `h_detmov` where fecha < 01/06/2010
espero que alguien tenga alguna sugerencia.
Desde ya muchas gracias.
Ale
How your date field is stored is how you must reference it in SQL. For instance, a lot of our dates are stored as an integer like this:
20100601
Therefore, my SQL is this:
WHERE date < 20100601
But there are a lot of other date formats that you could be using. Whatever date format the database is using is the date format you need to use when comparing a literal to the database field. That is what the SQL error is telling you.
Hola John.
No esta tomando el formato que sugeriste, pero si decis que el error el por el formato, voy a investigar un poco mas e ir probando otros, hasta que uno funcione.
Gracias.
también puedes tratar convirtiendo la fecha a numero, por ejemplo 01/06/2010 es el numero 40330.