Query: Select records with missing SecurityGLAccountId

Use these queries to display invalid records (SQL Query):

  • Select distinct [ArtDepPayment].[DBId] from [ArtDepPayment] where ([SecurityGLAccountId] = 0 or [SecurityGLAccountId] is null) and not [ArticleId] = 0 and not [ArticleId] is null Union Select distinct [AccInterest].[DBId] from [AccInterest] where ([SecurityGLAccountId] = 0 or [SecurityGLAccountId] is null) and not [ArticleId] = 0 and not [ArticleId] is null Union Select distinct [Dividend].[DBId] from [Dividend] where ([SecurityGLAccountId] = 0 or [SecurityGLAccountId] is null) and not [SecurityId] = 0 and not [SecurityId] is null Union Select distinct [StockTransfer].[DBId] from ([StockTransfer] inner join [Article] on ([StockTransfer].[ArticleId] = [Article].[Id] and [StockTransfer].[DBId] = [Article].[DBId])) where [Article].[Type] = 2 and ([StockTransfer].[GLAccountId] = 0 or [StockTransfer].[GLAccountId] is null) and not [ArticleId] = 0 and not [ArticleId] is null

  • Select * from [ArtDepPayment] where ([SecurityGLAccountId] = 0 or [SecurityGLAccountId] is null)and not [ArticleId] = 0 and not [ArticleId] is null
  • Select distinct [AccInterest].[DBId] from [AccInterest] where ([SecurityGLAccountId] = 0 or [SecurityGLAccountId] is null) and not [ArticleId] = 0 and not [ArticleId] is null
  • Select distinct [Dividend].[DBId] from [Dividend] where ([SecurityGLAccountId] = 0 or [SecurityGLAccountId] is null) and not [SecurityId] = 0 and not [SecurityId] is null
  • Select distinct [StockTransfer].[DBId] from ([StockTransfer] inner join [Article] on ([StockTransfer].[ArticleId] = [Article].[Id] and [StockTransfer].[DBId] = [Article].[DBId])) where [Article].[Type] = 2 and ([StockTransfer].[GLAccountId] = 0 or [StockTransfer].[GLAccountId] is null) and not [ArticleId] = 0 and not [ArticleId] is null