{"id":12666,"date":"2021-11-11T15:59:23","date_gmt":"2021-11-11T18:59:23","guid":{"rendered":"http:\/\/kb.elipse.com.br\/en\/?p=12666"},"modified":"2021-11-11T15:59:23","modified_gmt":"2021-11-11T18:59:23","slug":"sum-total-filtered-by-date-with-overtransact-sql-clause","status":"publish","type":"post","link":"https:\/\/kb.elipse.com.br\/en\/sum-total-filtered-by-date-with-overtransact-sql-clause\/","title":{"rendered":"Sum total filtered by date with OVER(Transact-sql) clause."},"content":{"rendered":"<p>This article shows how to retrieve the sum total of an estimated time period by using OVER clause alongside WHERE clause in Elipse E3.<\/p>\n<p style=\"text-align: justify;\">According to <a href=\"https:\/\/docs.microsoft.com\/en-us\/sql\/t-sql\/queries\/select-over-clause-transact-sql?view=sql-server-ver15\" target=\"_blank\" rel=\"noopener noreferrer\">Microsoft&#8217;s documentation<\/a>, the OVER clause is used with functions to compute aggregated values such as moving averages, cumulative aggregates, running totals, or a top N per group results. Therefore, it<\/p>\n<blockquote><p>(&#8230;) determines the partitioning and ordering of a rowset before applying the associated window function. That is, the OVER clause defines a window or user-specified set of rows within a query result set. A window function then computes a value for each row in the window.<\/p><\/blockquote>\n<p style=\"text-align: justify;\">Next, we will show you in the example below how to retrieve the sum total of an estimated time period by using the OVER clause alongside the WHERE clause.<\/p>\n<p><img loading=\"lazy\" class=\"aligncenter wp-image-12033 size-full\" src=\"http:\/\/kb.elipse.com.br\/wp-content\/uploads\/2021\/03\/12031\/tabela.png\" alt=\"soma acumulada com cl\u00e1usula OVER\" width=\"360\" height=\"305\" \/><\/p>\n<p style=\"text-align: justify;\">To get to this accumulated value, we will use the following SQL code in direct edition:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">SELECT Somatorio.E3TimeStamp, Somatorio.Campo, Sum(Somatorio.Campo) OVER(ORDER BY Somatorio.E3TimeStamp) AS Acumulado\r\nFROM Somatorio WHERE(Somatorio.E3TimeStamp >=#<%DataInicial%># AND Somatorio.E3TimeStamp <=#<%DataFinal%>#)\r\nORDER BY Somatorio.E3TimeStamp ASC<\/pre>\n<p style=\"text-align: justify;\">To use the demo application below, you must set up the Elipse E3 database to point to a database created in SQL Server Management Studio; then, when executing the application, a few records will be added via <strong>Record Register<\/strong> button:<\/p>\n<p><img loading=\"lazy\" class=\"aligncenter wp-image-12032\" src=\"http:\/\/kb.elipse.com.br\/wp-content\/uploads\/2021\/03\/12031\/sql.png\" alt=\"sum total OVER clause\" width=\"413\" height=\"451\" \/><\/p>\n<h3>Requirements:<\/h3>\n<p>&#8211;\u00a0 SQL Server database;<br \/>\n&#8211; Elipse E3 version 5.0.329 or higher.<\/p>\n<h3>Related articles:<\/h3>\n<hr \/>\n<ul>\n<li><a href=\"https:\/\/kb.elipse.com.br\/en\/tutorial-for-microsoft-sql-server-express-2017-installation-and-configuration\/\">Tutorial for Microsoft\u00ae SQL Server\u00ae Express 2017 installation and configuration.<\/a><\/li>\n<li><a href=\"https:\/\/kb.elipse.com.br\/en\/creating-a-cumulative-sum-with-an-sql-database-using-just-one-query\/\"> Creating a cumulative sum with an SQL database using just one query.<\/a><\/li>\n<li><a href=\"https:\/\/kb.elipse.com.br\/en\/using-databases-in-e3-chapter-2-connection-with-the-database\/\">Using databases with E3: Chapter 2 \u2013 Connection with the database.<\/a><\/li>\n<li><a href=\"https:\/\/docs.microsoft.com\/pt-br\/sql\/t-sql\/queries\/select-over-clause-transact-sql?view=sql-server-ver15\">SELECT \u2013 OVER clause (Transact-SQL)<\/a><\/li>\n<\/ul>\n<h3>Attachments:<\/h3>\n<p><a href=\"http:\/\/kb.elipse.com.br\/wp-content\/uploads\/2021\/03\/12031\/ProjetoSomatorio.zip\">ProjetoSomatorio.zip<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This article shows how to retrieve the sum total of an estimated time period by using OVER clause alongside WHERE clause in Elipse E3. According to Microsoft&#8217;s documentation, the OVER&hellip;<\/p>\n","protected":false},"author":24,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0},"categories":[735,743],"tags":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v19.8 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Sum total filtered by date with OVER(Transact-sql) clause.<\/title>\n<meta name=\"description\" content=\"This article shows how to retrieve the sum total of an estimated time period by using OVER clause alongside WHERE clause in Elipse E3.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/kb.elipse.com.br\/en\/sum-total-filtered-by-date-with-overtransact-sql-clause\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Sum total filtered by date with OVER(Transact-sql) clause.\" \/>\n<meta property=\"og:description\" content=\"This article shows how to retrieve the sum total of an estimated time period by using OVER clause alongside WHERE clause in Elipse E3.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/kb.elipse.com.br\/en\/sum-total-filtered-by-date-with-overtransact-sql-clause\/\" \/>\n<meta property=\"og:site_name\" content=\"Elipse Knowledgebase\" \/>\n<meta property=\"article:publisher\" content=\"http:\/\/www.facebook.com\/elipsesoftware\" \/>\n<meta property=\"article:published_time\" content=\"2021-11-11T18:59:23+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/kb.elipse.com.br\/wp-content\/uploads\/2021\/03\/12031\/tabela.png\" \/>\n<meta name=\"author\" content=\"Lucas Angelo dos Santos\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Lucas Angelo dos Santos\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/kb.elipse.com.br\/en\/sum-total-filtered-by-date-with-overtransact-sql-clause\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/kb.elipse.com.br\/en\/sum-total-filtered-by-date-with-overtransact-sql-clause\/\"},\"author\":{\"name\":\"Lucas Angelo dos Santos\",\"@id\":\"https:\/\/kb.elipse.com.br\/#\/schema\/person\/8274d4e8758d0bba9797ed62ca568851\"},\"headline\":\"Sum total filtered by date with OVER(Transact-sql) clause.\",\"datePublished\":\"2021-11-11T18:59:23+00:00\",\"dateModified\":\"2021-11-11T18:59:23+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/kb.elipse.com.br\/en\/sum-total-filtered-by-date-with-overtransact-sql-clause\/\"},\"wordCount\":250,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/kb.elipse.com.br\/#organization\"},\"articleSection\":[\"DataBases\",\"E3Query\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/kb.elipse.com.br\/en\/sum-total-filtered-by-date-with-overtransact-sql-clause\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/kb.elipse.com.br\/en\/sum-total-filtered-by-date-with-overtransact-sql-clause\/\",\"url\":\"https:\/\/kb.elipse.com.br\/en\/sum-total-filtered-by-date-with-overtransact-sql-clause\/\",\"name\":\"Sum total filtered by date with OVER(Transact-sql) clause.\",\"isPartOf\":{\"@id\":\"https:\/\/kb.elipse.com.br\/#website\"},\"datePublished\":\"2021-11-11T18:59:23+00:00\",\"dateModified\":\"2021-11-11T18:59:23+00:00\",\"description\":\"This article shows how to retrieve the sum total of an estimated time period by using OVER clause alongside WHERE clause in Elipse E3.\",\"breadcrumb\":{\"@id\":\"https:\/\/kb.elipse.com.br\/en\/sum-total-filtered-by-date-with-overtransact-sql-clause\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/kb.elipse.com.br\/en\/sum-total-filtered-by-date-with-overtransact-sql-clause\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/kb.elipse.com.br\/en\/sum-total-filtered-by-date-with-overtransact-sql-clause\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"In\u00edcio\",\"item\":\"https:\/\/kb.elipse.com.br\/en\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Sum total filtered by date with OVER(Transact-sql) clause.\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/kb.elipse.com.br\/#website\",\"url\":\"https:\/\/kb.elipse.com.br\/\",\"name\":\"Elipse Knowledgebase\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/kb.elipse.com.br\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/kb.elipse.com.br\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/kb.elipse.com.br\/#organization\",\"name\":\"Elipse Software\",\"url\":\"https:\/\/kb.elipse.com.br\/\",\"sameAs\":[\"http:\/\/www.facebook.com\/elipsesoftware\"],\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/kb.elipse.com.br\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/kb.elipse.com.br\/wp-content\/uploads\/2019\/05\/schererelipse-com-br\/logoElipse.png\",\"contentUrl\":\"https:\/\/kb.elipse.com.br\/wp-content\/uploads\/2019\/05\/schererelipse-com-br\/logoElipse.png\",\"width\":161,\"height\":58,\"caption\":\"Elipse Software\"},\"image\":{\"@id\":\"https:\/\/kb.elipse.com.br\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/kb.elipse.com.br\/#\/schema\/person\/8274d4e8758d0bba9797ed62ca568851\",\"name\":\"Lucas Angelo dos Santos\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/kb.elipse.com.br\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/89d677b6c8a8d6a100499aaec8fb46f6?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/89d677b6c8a8d6a100499aaec8fb46f6?s=96&d=mm&r=g\",\"caption\":\"Lucas Angelo dos Santos\"},\"url\":\"https:\/\/kb.elipse.com.br\/en\/author\/santos\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Sum total filtered by date with OVER(Transact-sql) clause.","description":"This article shows how to retrieve the sum total of an estimated time period by using OVER clause alongside WHERE clause in Elipse E3.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/kb.elipse.com.br\/en\/sum-total-filtered-by-date-with-overtransact-sql-clause\/","og_locale":"en_US","og_type":"article","og_title":"Sum total filtered by date with OVER(Transact-sql) clause.","og_description":"This article shows how to retrieve the sum total of an estimated time period by using OVER clause alongside WHERE clause in Elipse E3.","og_url":"https:\/\/kb.elipse.com.br\/en\/sum-total-filtered-by-date-with-overtransact-sql-clause\/","og_site_name":"Elipse Knowledgebase","article_publisher":"http:\/\/www.facebook.com\/elipsesoftware","article_published_time":"2021-11-11T18:59:23+00:00","og_image":[{"url":"http:\/\/kb.elipse.com.br\/wp-content\/uploads\/2021\/03\/12031\/tabela.png"}],"author":"Lucas Angelo dos Santos","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Lucas Angelo dos Santos","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/kb.elipse.com.br\/en\/sum-total-filtered-by-date-with-overtransact-sql-clause\/#article","isPartOf":{"@id":"https:\/\/kb.elipse.com.br\/en\/sum-total-filtered-by-date-with-overtransact-sql-clause\/"},"author":{"name":"Lucas Angelo dos Santos","@id":"https:\/\/kb.elipse.com.br\/#\/schema\/person\/8274d4e8758d0bba9797ed62ca568851"},"headline":"Sum total filtered by date with OVER(Transact-sql) clause.","datePublished":"2021-11-11T18:59:23+00:00","dateModified":"2021-11-11T18:59:23+00:00","mainEntityOfPage":{"@id":"https:\/\/kb.elipse.com.br\/en\/sum-total-filtered-by-date-with-overtransact-sql-clause\/"},"wordCount":250,"commentCount":0,"publisher":{"@id":"https:\/\/kb.elipse.com.br\/#organization"},"articleSection":["DataBases","E3Query"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/kb.elipse.com.br\/en\/sum-total-filtered-by-date-with-overtransact-sql-clause\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/kb.elipse.com.br\/en\/sum-total-filtered-by-date-with-overtransact-sql-clause\/","url":"https:\/\/kb.elipse.com.br\/en\/sum-total-filtered-by-date-with-overtransact-sql-clause\/","name":"Sum total filtered by date with OVER(Transact-sql) clause.","isPartOf":{"@id":"https:\/\/kb.elipse.com.br\/#website"},"datePublished":"2021-11-11T18:59:23+00:00","dateModified":"2021-11-11T18:59:23+00:00","description":"This article shows how to retrieve the sum total of an estimated time period by using OVER clause alongside WHERE clause in Elipse E3.","breadcrumb":{"@id":"https:\/\/kb.elipse.com.br\/en\/sum-total-filtered-by-date-with-overtransact-sql-clause\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/kb.elipse.com.br\/en\/sum-total-filtered-by-date-with-overtransact-sql-clause\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/kb.elipse.com.br\/en\/sum-total-filtered-by-date-with-overtransact-sql-clause\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"In\u00edcio","item":"https:\/\/kb.elipse.com.br\/en\/"},{"@type":"ListItem","position":2,"name":"Sum total filtered by date with OVER(Transact-sql) clause."}]},{"@type":"WebSite","@id":"https:\/\/kb.elipse.com.br\/#website","url":"https:\/\/kb.elipse.com.br\/","name":"Elipse Knowledgebase","description":"","publisher":{"@id":"https:\/\/kb.elipse.com.br\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/kb.elipse.com.br\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/kb.elipse.com.br\/#organization","name":"Elipse Software","url":"https:\/\/kb.elipse.com.br\/","sameAs":["http:\/\/www.facebook.com\/elipsesoftware"],"logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/kb.elipse.com.br\/#\/schema\/logo\/image\/","url":"https:\/\/kb.elipse.com.br\/wp-content\/uploads\/2019\/05\/schererelipse-com-br\/logoElipse.png","contentUrl":"https:\/\/kb.elipse.com.br\/wp-content\/uploads\/2019\/05\/schererelipse-com-br\/logoElipse.png","width":161,"height":58,"caption":"Elipse Software"},"image":{"@id":"https:\/\/kb.elipse.com.br\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/kb.elipse.com.br\/#\/schema\/person\/8274d4e8758d0bba9797ed62ca568851","name":"Lucas Angelo dos Santos","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/kb.elipse.com.br\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/89d677b6c8a8d6a100499aaec8fb46f6?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/89d677b6c8a8d6a100499aaec8fb46f6?s=96&d=mm&r=g","caption":"Lucas Angelo dos Santos"},"url":"https:\/\/kb.elipse.com.br\/en\/author\/santos\/"}]}},"_links":{"self":[{"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/posts\/12666"}],"collection":[{"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/users\/24"}],"replies":[{"embeddable":true,"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/comments?post=12666"}],"version-history":[{"count":5,"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/posts\/12666\/revisions"}],"predecessor-version":[{"id":12671,"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/posts\/12666\/revisions\/12671"}],"wp:attachment":[{"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/media?parent=12666"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/categories?post=12666"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/tags?post=12666"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}