Search code examples
javascriptsqlpentahokettle

Problems with Javascript + Kettle + Input table


I have a problem when trying to filter an input table using javascript.

this is my javascript code:

var fecha = new Date();
var mes = (fecha.getMonth() +1)<10 ? "0"+(fecha.getMonth()+1) : (fecha.getMonth()+1);
var fecha_inicio = fecha.getFullYear()+"-" + mes + "-" + "01";
var fecha_fin = fecha.getFullYear()+"-" + mes + "-" + "30";

if(fecha.getMonth()==0 || fecha.getMonth()==2 || fecha.getMonth()==4 || fecha.getMonth()==6 || fecha.getMonth()==7 || fecha.getMonth()==9 || fecha.getMonth()==11){

fecha_fin = fecha.getFullYear()+"-" + mes + "-" + "31";

}

and the sql query I have this code:

SELECT l.*, au.nombre as nombre_autor, au.apellido 
FROM libros l 
INNER JOIN author au 
ON au.idauthor=l.autor 
WHERE l.fecha_llegada BETWEEN ? AND ?;

I try to return an empty list, check out all previous data and even blank javascript variables, help please!


Solution

  • I have solved the problem. the problem was that apparently can not start a job or a transformation script javascript so here I put a data grid step before and began to send me the script varibles.

    Regards!