0

业务对象 GeneralJournalEntryLines 包含 Exact Online 的 GL 交易行。出于性能调整的原因,我们正在更改将数据从 Exact Online 复制到我们的本地数据库的脚本,以仅包含可能的更改而不是完整副本。

但是,对与 GeneralJournalEntryLines 连接的 GeneralJournalEntries 的查询有时会在 CreatorFullName 和 ModifiedFullName 中返回空值。

我试图重现这个问题的新行,但这些工作正常。

这是数据库损坏吗?还是我这边的加入错误?

确切的在线查询是:

use <DIVISION CODE>

select GE.Created GE_Created
      ,GE.Division GE_Division
      ,GE.EntryID GE_EntryID
      ,GE.EntryNumber GE_EntryNumber
      ,GE.FinancialPeriod GE_FinancialPeriod
      ,GE.FinancialYear GE_FinancialYear
      ,GE.JournalCode GE_JournalCode
      ,GE.Modified GE_Modified
      ,GE.Reversal GE_Reversal
      ,GE.Status GE_Status
      ,GE.Type GE_Type
      ,GL.AccountCode GL_AccountCode
      ,GL.AmountDC GL_AmountDC
      ,GL.AmountVATDC GL_AmountVATDC
      ,GL.AssetCode GL_AssetCode
      ,GL.CostCenter GL_CostCenter
      ,GL.CostUnit GL_CostUnit
      ,GL.CreatorFullName GL_CreatorFullName
      ,GL.Date GL_Date
      ,GL.Description GL_Description
      ,GL.GLAccountCode GL_GLAccountCode
      ,GL.LineNumber GL_LineNumber
      ,GL.ModifierFullName GL_ModifierFullName
      ,GL.OurRef GL_OurRef
      ,GL.ProjectCode GL_ProjectCode
      ,GL.Quantity GL_Quantity
      ,GL.VATBaseAmountDC GL_VATBaseAmountDC
      ,GL.VATCode GL_VATCode
      ,GL.VATPercentage GL_VATPercentage
      ,GL.VATType GL_VATType
from       ExactOnlineREST..GeneralJournalEntries GE
inner join ExactOnlineREST..GeneralJournalEntryLines GL
on GE.EntryID=GL.EntryID
where GE.Status <> 50 
or ( GE.Status = 50 and ( (GE.FinancialYear*100) + GE.FinancialPeriod = 201501 and GE.Modified > '09/01/2017 14:03:09' ) ) 
or ( GE.Status = 50 and ( (GE.FinancialYear*100) + GE.FinancialPeriod = 201502 and GE.Modified > '09/01/2017 14:03:09' ) ) 
or ( GE.Status = 50 and ( (GE.FinancialYear*100) + GE.FinancialPeriod = 201503 and GE.Modified > '09/01/2017 14:03:09' ) ) 
or ( GE.Status = 50 and ( (GE.FinancialYear*100) + GE.FinancialPeriod = 201504 and GE.Modified > '09/01/2017 14:03:09' ) ) 
or ( GE.Status = 50 and ( (GE.FinancialYear*100) + GE.FinancialPeriod = 201505 and GE.Modified > '09/01/2017 14:03:08' ) ) 
or ( GE.Status = 50 and ( (GE.FinancialYear*100) + GE.FinancialPeriod = 201506 and GE.Modified > '09/01/2017 14:03:08' ) ) 
or ( GE.Status = 50 and ( (GE.FinancialYear*100) + GE.FinancialPeriod = 201507 and GE.Modified > '09/01/2017 14:27:27' ) ) 
or ( GE.Status = 50 and ( (GE.FinancialYear*100) + GE.FinancialPeriod = 201508 and GE.Modified > '09/01/2017 14:27:27' ) ) 
or ( GE.Status = 50 and ( (GE.FinancialYear*100) + GE.FinancialPeriod = 201509 and GE.Modified > '09/01/2017 14:27:27' ) ) 
or ( GE.Status = 50 and ( (GE.FinancialYear*100) + GE.FinancialPeriod = 201510 and GE.Modified > '09/01/2017 14:27:26' ) ) 
or ( GE.Status = 50 and ( (GE.FinancialYear*100) + GE.FinancialPeriod = 201511 and GE.Modified > '09/01/2017 14:27:27' ) ) 
or ( GE.Status = 50 and ( (GE.FinancialYear*100) + GE.FinancialPeriod = 201512 and GE.Modified > '09/01/2017 14:27:26' ) ) 

local export results as "D:\Invantive\data\uit_EOL\40570GeneralJournals.csv" format csv

local exit
4

1 回答 1

1

使用查询时:

select * 
from   ExactOnlineREST..GeneralJournalEntryLines GL
where  gl.modifierfullname is null or gl.creatorfullname is null

似乎所有缺少modifiedfullnameor的行都具有来自短列表的关联用户 GUID。creatorfullname它也是(基于创建日期)所有具有相当年龄的记录。

似乎 Exact Online API 在内部与 users 表进行了左外连接,不再活跃的用户不会返回任何信息。

于 2017-04-04T06:34:53.070 回答