{"id":11780,"date":"2022-06-28T12:46:22","date_gmt":"2022-06-28T11:46:22","guid":{"rendered":"https:\/\/sdna.lu\/?p=11780"},"modified":"2022-09-01T14:41:17","modified_gmt":"2022-09-01T13:41:17","slug":"query-compare-initial-balance-and-y-e-closing","status":"publish","type":"post","link":"https:\/\/sdna.lu\/?p=11780","title":{"rendered":"Query: Compare initial balance and Y\/E Closing"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Select [GLAccountCur].[DBId], [GLAccount].[Number], [GLAccountCur].[GLAccountId], [GLAccountCur].[CurrencyId], [GLAccountCur].[Amount], [ResGLYEBalance].[StartBalance] <br>from ([GLAccountCur] <br>LEFT JOIN (Select [GLYEBalance].[DBId], [GLYEBalance].[GLAccountId], [GLYEBalance].[CurrencyId], [GLYEBalance][StartBalance]from [GLYEBalance] <br>INNER JOIN(Select [GLPeriod].[DBId], [Id] from [GLPeriod] <br>INNER JOIN(Select [DBId], Min([StartDate]) as [ResStartDate] from [GLPeriod] Group by [DBId]) as [MinGLPeriod]<br>ON ([GLPeriod].[DBId] = [MinGLPeriod].[DBId] and [GLPeriod].[StartDate] = [MinGLPeriod].[ResStartDate])) as [FirstGLPeriod]<br>ON ([GLYEBalance].[GLPeriodId] = [FirstGLPeriod].[Id] and [GLYEBalance].[DBId] = [FirstGLPeriod].[DBId])) as [ResGLYEBalance]<br>ON [GLAccountCur].[GLAccountId] = [ResGLYEBalance].[GLAccountId]<br>AND [GLAccountCur].[CurrencyId] = [ResGLYEBalance].[CurrencyId]<br>AND [GLAccountCur].[DBId] = [ResGLYEBalance].[DBId])<br>INNER JOIN [GLAccount]<br>ON ([GLAccountCur].[GLAccountId] = [GLAccount].[Id] and [GLAccountCur].[DBId] = [GLAccount].[DBId])<br>where Not [GLAccountCur].[Amount] = [ResGLYEBalance].[StartBalance]<br>order by [GLAccountCur].[DBId], [GLAccount].[Number]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Select [GLAccountCur].[DBId], [GLAccount].[Number], [GLAccountCur].[GLAccountId], [GLAccountCur].[CurrencyId], [GLAccountCur].[Amount], [ResGLYEBalance].[StartBalance] from ([GLAccountCur] LEFT JOIN (Select [GLYEBalance].[DBId], [GLYEBalance].[GLAccountId], [GLYEBalance].[CurrencyId], [GLYEBalance][StartBalance]from [GLYEBalance] INNER JOIN(Select [GLPeriod].[DBId], [Id] from [GLPeriod] INNER JOIN(Select [DBId], Min([StartDate]) as [ResStartDate] from [GLPeriod] Group by [DBId]) as [MinGLPeriod]ON ([GLPeriod].[DBId] = [MinGLPeriod].[DBId] and [GLPeriod].[StartDate] = [MinGLPeriod].[ResStartDate])) as [FirstGLPeriod]ON ([GLYEBalance].[GLPeriodId] = [FirstGLPeriod].[Id] and [GLYEBalance].[DBId] = [FirstGLPeriod].[DBId])) as [ResGLYEBalance]ON [GLAccountCur].[GLAccountId] [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[487],"tags":[],"class_list":["post-11780","post","type-post","status-publish","format-standard","hentry","category-query"],"_links":{"self":[{"href":"https:\/\/sdna.lu\/index.php?rest_route=\/wp\/v2\/posts\/11780","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\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/sdna.lu\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=11780"}],"version-history":[{"count":1,"href":"https:\/\/sdna.lu\/index.php?rest_route=\/wp\/v2\/posts\/11780\/revisions"}],"predecessor-version":[{"id":11782,"href":"https:\/\/sdna.lu\/index.php?rest_route=\/wp\/v2\/posts\/11780\/revisions\/11782"}],"wp:attachment":[{"href":"https:\/\/sdna.lu\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=11780"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sdna.lu\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=11780"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sdna.lu\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=11780"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}