Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

SQL statements is not working on load script editor

Hello everybody

I am trying to upload a sql statement in the load script editor using Qlik sense Desktop. In my local machine using mysql Workbench the query is working. I'm getting always the following error.

Error message.PNG

I have also checked the time format settings

Format.PNG

The code i am using:

SELECT

    SEC_TO_TIME(SUM(UNIX_TIMESTAMP(r.start_date) - UNIX_TIMESTAMP(s.end_date)) / (COUNT(CURDATE()))) AS Average,

    DATE_FORMAT(start_date, '%Y-%m-%d') AS DAY

FROM

    db.table1 r,

    db.table2 s

WHERE

    r.id = s.id

        AND TIMEDIFF(r.start_date, s.end_date) IS NOT NULL

GROUP BY day

ORDER BY start_date;

start date and enddate are saved in datetimeformat. As you can see i'm groupping datetime value in a day value. I'm not sure if this is the probelm. If yes can anybody tell me how to fix this problem?

0 Replies