I just added your query to the unit tests for the SQL parser and it seemed to pass with flying colours. The Parser has recently had some improvements made to it, but nothing specifically for the IN clause so it is my guess that it should work in older versions too.

The timediff works perfectly now, thanks! I didn't realize the fix would be so simple. The datediff also works.

Maybe I can make it a bit more challenging....

This function works from the inside out (including the TIMEDIFF and the TIME_TO_SEC) until I add the /3600. Is there still a problem with arithmetic in the SQL parser in version 1.3? If so, I think I can use the fieldname__display function to do the final math there.

Thanks. it is likely that the parser doesn't support the "INTERVAL" keyword yet. Unfortunately adding support for this keyword is more involved than just adding support for individual function names because it will affect the structure of the parse tree. Not sure when I'll have a chance to open this bug.

Okay, no problem. I am just using the DATEDIFF() function instead for now. But there may be other cases where DATE_ADD(), DATE_SUB(), or their synonymous functions ADDDATE() or SUBDATE() are needed.

Incidentally, I did check Dialect_MySQL.php, and I noticed that interval is listed as a function and a reserved word, so I figured it must be more involved. I also noticed all of the date functions mentioned above are already defined in the file, but they won't work without the INTERVAL keyword.