-
javascript issue
Hi,
I have an issue with javascript (It's a javascript inside an xaction).
I want to do this filter in Pentaho Designer but for some reason if giving me errors about a ; ,but I don't know why.
Filtro1='';
if(TransportingAirline!='All')
{ Filtro1=' AND Airlines.id =\'' + TransportingAirline + '\''; }
if(datefrom!='All')
{Filtro1=Filtro1 + ' AND DATE_FORMAT(Reservations.reservation_date, '%Y-%m-%d 00:00:00') > DATE_FORMAT('\'' + datefrom + '\''',%Y-%m-%d 00:00:00') '';}
if(dateto!='All')
{Filtro1=Filtro1 + ' AND DATE_FORMAT(Reservations.reservation_date, '%Y-%m-%d 00:00:00') < DATE_FORMAT('\'' + dateto + '\''',%Y-%m-%d 00:00:00') '';}
datefrom and dateto are parameters and Filtro1 is defined as Filtro1='';
The error is :
org.mozilla.javascript.EvaluatorException: missing ; before statement (<cmd>#7)
Thanks in advance for your quick response.
-
You did not escaped quotes wrapping the first date format in lines #7 and #10.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules