无法在netsuite2.com SQL查询的WHERE子句中使用lastmodifiedate



我正试图对netsuite2.com运行一个查询,如下所示:

select lastmodifieddate from transaction where lastmodifieddate>'2016-06-16 18:50:50'

但这会产生一个错误:

[NetSuite][SuiteAnalytics Connect JDBC Driver][OpenAccess SDK SQL Engine]Failed to retrieve data. Error ticket# kybpw8j91333lgz1ovora[400]

p.s.我使用的是NQjc.jar JDBC驱动程序。

此问题与用于连接到分析架构的帐户上的日期时间设置有关。为了确保它适用于所有情况,请使用To_date函数将字符串表示转换为sqldatetime对象:

select lastmodifieddate from transaction 
where lastmodifieddate > to_date('2016-06-16 18:50:50', 'yyyy-mm-dd hh:mi:ss')

我在通过Azure数据工厂管道使用NetSuite ODBC时遇到了同样的问题。我尝试了to_date()方法,但没有成功。我得到了以下错误:

"源"端发生故障。ErrorCode=UserErrorOdbcOperationFailed,'Type=Microsoft.DataTransfer。Common.Shared.HybridDeliveryException,Message=ERROR[S100][NetSuite][ODBC 64位驱动程序][OpenAccess SDK SQL引擎]检索数据失败。错误票证#lggq6m75keahp9wgn87v[400],源=Microsoft.DataTransfer.Runtime.GenericOdbcConnectors,'Type=System.Data.Odbc.OdbcException,消息=Error[S100][NetSuite][Odbc 64位驱动程序][OpenAccess SDK SQL引擎]检索数据失败。错误票证#lggq6m75keahp9wgn87v[400],源=NQoa27.dll,'

我发现了另一种似乎有效的方法;我用过:

TO_CHAR(lastmodifieddate, 'YYYY-MM-DD HH24:MI:SS') > '2016-06-16 18:50:50';

我通过以下方式找到了此信息:https://timdietrich.me/blog/netsuite-suiteql-dates-times/

最新更新