我在X ++中查询时遇到了一些问题。
Query extended range failure: SPLCertificateSell.ValidFrom is not a valid datasource.field pair near pos 36.
我尝试使用utcdatetime查询QueryBuildRange但是我收到错误('validFrom'是dateTime而'DateTimeUtil :: getSystemDateTime()'返回utcDateTime):
qbrCertificateSell2 = qbdsCertificateSell.addRange(fieldNum(SPLCertificateSell, ValidFrom));
qbrCertificateSell2.value(strFmt('( (%1.%2 <= "%3") )'
,tableStr(SPLCertificateSell)
,fieldStr(SPLCertificateSell, ValidFrom)
,DateTimeUtil::getSystemDateTime()
));
答案 0 :(得分:1)
您需要将UTCDateTtime
转换为System.DateTime
尝试此功能:Global::utcDateTime2SystemDateTime()
例如,在您的代码中:
qbrCertificateSell2 = qbdsCertificateSell.addRange(fieldNum(SPLCertificateSell, ValidFrom));
qbrCertificateSell2.value(strFmt('( (%1.%2 <= "%3") )'
,tableStr(SPLCertificateSell)
,fieldStr(SPLCertificateSell, ValidFrom)
,Global::utcDateTime2SystemDateTime(DateTimeUtil::getSystemDateTime())
));