{"id":6642,"date":"2018-10-23T15:30:43","date_gmt":"2018-10-23T14:30:43","guid":{"rendered":"http:\/\/help.sdna.lu\/?p=6642&#038;lang=en"},"modified":"2021-04-28T20:34:57","modified_gmt":"2021-04-28T19:34:57","slug":"query-to-select-records-with-missing-securityglaccountid","status":"publish","type":"post","link":"https:\/\/sdna.lu\/?p=6642","title":{"rendered":"Query: Select records with missing SecurityGLAccountId"},"content":{"rendered":"<h4 class=\"entry-title\">Use these queries to display invalid records (SQL Query):<\/h4>\n<div class=\"entry-content\">\n<ul>\n<li>\n<p><code>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<\/code><\/p>\n<\/li>\n<\/ul>\n<\/div>\n\n\n<ul class=\"wp-block-list\"><li><code>Select * from [ArtDepPayment] where <strong>(<\/strong>[SecurityGLAccountId] = 0 or [SecurityGLAccountId] is null)and not [ArticleId] = 0 and not [ArticleId] is null<\/code><\/li><\/ul>\n\n\n\n<ul class=\"wp-block-list\"><li> <code>Select distinct [AccInterest].[DBId] from [AccInterest] where ([SecurityGLAccountId] = 0 or [SecurityGLAccountId] is null) and not [ArticleId] = 0 and not [ArticleId] is null<\/code><\/li><\/ul>\n\n\n\n<ul class=\"wp-block-list\"><li> <code>Select distinct [Dividend].[DBId] from [Dividend] where ([SecurityGLAccountId] = 0 or [SecurityGLAccountId] is null) and not [SecurityId] = 0 and not [SecurityId] is null<\/code><\/li><\/ul>\n\n\n\n<ul class=\"wp-block-list\"><li> <code>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<\/code><\/li><\/ul>\n","protected":false},"excerpt":{"rendered":"<p>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 [&hellip;]<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[487],"tags":[],"class_list":["post-6642","post","type-post","status-publish","format-standard","hentry","category-query"],"_links":{"self":[{"href":"https:\/\/sdna.lu\/index.php?rest_route=\/wp\/v2\/posts\/6642","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sdna.lu\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sdna.lu\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sdna.lu\/index.php?rest_route=\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/sdna.lu\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=6642"}],"version-history":[{"count":15,"href":"https:\/\/sdna.lu\/index.php?rest_route=\/wp\/v2\/posts\/6642\/revisions"}],"predecessor-version":[{"id":7533,"href":"https:\/\/sdna.lu\/index.php?rest_route=\/wp\/v2\/posts\/6642\/revisions\/7533"}],"wp:attachment":[{"href":"https:\/\/sdna.lu\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=6642"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sdna.lu\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=6642"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sdna.lu\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=6642"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}