{"id":11228,"date":"2021-02-03T17:42:13","date_gmt":"2021-02-03T16:42:13","guid":{"rendered":"https:\/\/sdna.lu\/?p=11228"},"modified":"2021-04-28T20:30:02","modified_gmt":"2021-04-28T19:30:02","slug":"query-check-accounts-in-options","status":"publish","type":"post","link":"https:\/\/sdna.lu\/?p=11228","title":{"rendered":"Query: Check accounts in options"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"><code>Select * from [Options] where \nconvert(varchar, [Options].[DBId]) + '-' + [Options].[Variable] + '-' + [Options].[OrgTable] + '-' + [Options].[OrgTable] + '-' + convert(varchar, [Options].[FieldId])\nin (Select convert(varchar, [Options].[DBId]) + '-' + [Options].[Variable] + '-' + [Options].[OrgTable] + '-' + [Options].[OrgTable] + '-' + convert(varchar, [Options].[FieldId]) from \n([Options] Left Join [GLAccount] \nON [Options].[ReferenceId] = [GLAccount].[Id] and [Options].[DBId] = [GLAccount].[DBId]) \nwhere Not [Options].[ReferenceId] = 0 and [GLAccount].[Id] is null)<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Select * from [Options] where convert(varchar, [Options].[DBId]) + &#8216;-&#8216; + [Options].[Variable] + &#8216;-&#8216; + [Options].[OrgTable] + &#8216;-&#8216; + [Options].[OrgTable] + &#8216;-&#8216; + convert(varchar, [Options].[FieldId]) in (Select convert(varchar, [Options].[DBId]) + &#8216;-&#8216; + [Options].[Variable] + &#8216;-&#8216; + [Options].[OrgTable] + &#8216;-&#8216; + [Options].[OrgTable] + &#8216;-&#8216; + convert(varchar, [Options].[FieldId]) from ([Options] Left Join [GLAccount] ON [Options].[ReferenceId] = [GLAccount].[Id] and [&hellip;]<\/p>\n","protected":false},"author":19,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[487],"tags":[],"class_list":["post-11228","post","type-post","status-publish","format-standard","hentry","category-query"],"_links":{"self":[{"href":"https:\/\/sdna.lu\/index.php?rest_route=\/wp\/v2\/posts\/11228","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\/19"}],"replies":[{"embeddable":true,"href":"https:\/\/sdna.lu\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=11228"}],"version-history":[{"count":3,"href":"https:\/\/sdna.lu\/index.php?rest_route=\/wp\/v2\/posts\/11228\/revisions"}],"predecessor-version":[{"id":11239,"href":"https:\/\/sdna.lu\/index.php?rest_route=\/wp\/v2\/posts\/11228\/revisions\/11239"}],"wp:attachment":[{"href":"https:\/\/sdna.lu\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=11228"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sdna.lu\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=11228"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sdna.lu\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=11228"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}