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

问题描述 投票:0回答:2

我正在尝试对 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]

附注我正在使用 NQjc.jar JDBC 驱动程序。

netsuite
2个回答
2
投票

此问题与用于连接到分析模式的帐户的日期时间设置有关。为确保它适用于所有情况,请使用 to_date 函数将字符串表示形式转换为 sql

datetime
对象:

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

0
投票

我在通过 Azure 数据工厂管道使用 NetSuite ODBC 时遇到了同样的问题。我尝试了

to_date()
方法,但没有用。我收到以下错误:

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

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

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

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

© www.soinside.com 2019 - 2024. All rights reserved.