Received exception with message 'Incorrect syntax near 'AT'.'

can please some one point me what does this error mean. The same query works fine in DEV and fails in QA **select *,FORMATDATE('yyyy-MM-dd', dob)** Finished with error: Error executing query. Total time 0.273 seconds. DV_XXXX_name [VIRTUAL] [ERROR] DV_XXXX_name [JDBC WRAPPER] [ERROR] DV_XXXX_name#0 [JDBC ROUTE] [ERROR] Received exception with message 'Incorrect syntax near 'AT'.' here is the log 2094829972 [Access(2747502)-3334-04.00-xx.xxxx_name] ERROR 2018-07-24T21:32:43.832 com.denodo.vdb.engine.wrapper.raw.jdbc.JDBCAccess [] - [*]SQLE Incorrect syntax near 'AT'., idconnection=189731369 com.microsoft.sqlserver.jdbc.SQLServerException: Incorrect syntax near 'AT'. at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:216) ~[sqljdbc4.jar:?] at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(SQLServerStatement.java:1515) ~[sqljdbc4.jar:?] at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.doExecutePreparedStatement(SQLServerPreparedStatement.java:404) ~[sqljdbc4.jar:?] at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement$PrepStmtExecCmd.doExecute(SQLServerPreparedStatement.java:350) ~[sqljdbc4.jar:?] at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:5696) ~[sqljdbc4.jar:?] at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:1715) ~[sqljdbc4.jar:?] at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(SQLServerStatement.java:180) ~[sqljdbc4.jar:?]
user
25-07-2018 00:35:24 -0400

1 Answer

Hi, This looks like a syntax error to me. All the examples in the [date processing](https://community.denodo.com/docs/html/browse/6.0/vdp/vql/appendix/syntax_of_condition_functions/date_processing_functions#formatdate) functions for FORMATDATE have the FROM clause included. Here is a similar example based on the syntax shown in the article: ``` SELECT dob, formatdate('h:mm a', dob) AS format_date FROM v ``` Without the full query being shown, I am not 100% confident this will solve the problem, but that is the possible syntax error that I can see from **select *,FORMATDATE(‘yyyy-MM-dd’, dob)**. As an aside, if you have a valid support account, you can submit a case if you wish and the support team can take a deeper look into the error. Hope this helps!
Denodo Team
25-07-2018 16:54:17 -0400
You must sign in to add an answer. If you do not have an account, you can register here