Hello list, <br><br>I'm having some problem integrating the SELECT TIMEDIFF() and SELECT DATEDIFF() in my code. The syntax I'm using works without any problems if I run them directly from the MySQL Client, but from the Asterisk Dialplan it just wont work. Is there a limitation in the MySQL() application for the Asterisk dialplan that produces this error?<br>
<br><CODE><br>context testsql {<br> s => {<br> MYSQL(Connect connid ${DBHOST} ${DBUSER} ${DBPASS} ${DB});<br> MYSQL(Query resultid ${connid} SELECT TIMEDIFF(callend,callstart) FROM tblCall WHERE id=7);<br>
MYSQL(fetch fetchid ${resultid} temp);<br> MYSQL(Disconnect ${connid});<br> }<br>}<br></CODE><br><br>The error I'm getting is below: <br>[Mar 6 08:59:35] WARNING[27116]: app_addon_sql_mysql.c:268 aMYSQL_query: aMYSQL_query: mysql_query failed. Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') FROM tblCall WHERE id=7' at line 1<br>
<br>Has anyone done this kind of calculation before, or is there a better way to do it? <br><br>Thanks, <br>Best regards, <br>Tobias<br>