Using interval on mysql


(Bianca Morton) #1

I have a query that needs to select somethign like
WHERE sl.date_generated > DATE_ADD(sle.first_scan, INTERVAL 1 DAY)
but i am getting this error:
SQL compilation error: syntax error line 4 at position 64 unexpected ‘1’.
when i copy the query and paste it on a regular mysql ide it runs no problem.
How do I achieve this with sql runner on looker?

(Izzy) #2

Are you certain your SQL Runner query is hitting a MySQL database as well? If the database you’re hitting from Looker isn’t MySQL, maybe that syntax won’t work since it’s a different dialect…

Seeing the full query would also be helpful— Cause at first glance this sounds like it ought to work totally fine.