{"id":87,"date":"2014-01-02T23:07:38","date_gmt":"2014-01-02T15:07:38","guid":{"rendered":"http:\/\/suherman.asia\/w2\/?p=87"},"modified":"2014-03-07T11:29:45","modified_gmt":"2014-03-07T03:29:45","slug":"end-of-month-function","status":"publish","type":"post","link":"http:\/\/suherman.asia\/w2\/end-of-month-function.html","title":{"rendered":"End Of Month Function"},"content":{"rendered":"<p>Gak sengaja lagi buka-buka helpnya SQL Server 2012 kemudian menemukan sebuah function baru dalam pengelolaan tanggal yaitu function End of Month atau ditulis dengan EOMonth()<\/p>\n<p>Biasanya kalo kita mau mencari tanggal berapa sebuah bulan berakhir, kita dapat menggunakan cara berikut :<\/p>\n<pre class=\"theme:ssms2012 lang:tsql decode:true \">DECLARE @DATE DATETIME \r\nSET @DATE='2013-01-17' \r\nSELECT CONVERT(VARCHAR(10),DATEADD(ms,-2,DATEADD(MONTH, \r\nDATEDIFF(MONTH,0,@DATE)+1,0)),120) AS [EndOfMonth]<\/pre>\n<p>cukup panjang bukan. Namun di SQL Server 2012 kini telah tersedia function khusus untuk kasus diatas.<\/p>\n<div id=\"codeSnippetWrapper\">\n<div class=\"csharpcode\" id=\"codeSnippet\">\n<p>Syntax nya adalah sebagai berikut :<\/p>\n<p>EOMONTH ( start_date [, month_to_add ] )<\/p>\n<p>Start_date adalah tanggal dimana tanggal akhir bulan pada start_date tersebut hendak dicari.<\/p>\n<p>month_to_add merupakan optional integer expression yang akan memberikan interval bulan yang akan dicari dari bulan yang tertera di start_date.<\/p>\n<p>contoh penggunaannya adalah sebagai berikut :<\/p>\n<div class=\"csharpcode-wrapper\">\n<pre class=\"theme:ssms2012 lang:tsql decode:true \">DECLARE @start_date DATETIME \r\nSET @start_date='2013-01-17'  \r\n--Mencari tanggal akhir pada bulan yang tertera di start_date\r\nselect EOMONTH(@start_date) [Akhir Bulan] \r\n\r\n--Mencari tanggal akhir pada 2 bulan setelah start_date\r\nselect EOMONTH(@start_date,2) [Akhir Bulan] \r\n\r\n--Mencari tanggal akhir pada 2 bulan sebelum start_date\r\nselect EOMONTH(@start_date,-2) [Akhir Bulan]<\/pre>\n<p><span style=\"font-size: 13px;\">demikian semoga bermanfaat.<\/span><\/p>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Gak sengaja lagi buka-buka helpnya SQL Server 2012 kemudian menemukan sebuah function baru dalam pengelolaan tanggal yaitu function End of Month atau ditulis dengan EOMonth() Biasanya kalo kita mau mencari tanggal berapa sebuah bulan berakhir, kita dapat menggunakan cara berikut : DECLARE @DATE DATETIME SET @DATE=&#8217;2013-01-17&#8242; SELECT CONVERT(VARCHAR(10),DATEADD(ms,-2,DATEADD(MONTH, DATEDIFF(MONTH,0,@DATE)+1,0)),120) AS \u2026<\/p>\n<p class=\"continue-reading-button\"> <a class=\"continue-reading-link\" href=\"http:\/\/suherman.asia\/w2\/end-of-month-function.html\">Continue reading<i class=\"crycon-right-dir\"><\/i><\/a><\/p>\n","protected":false},"author":1,"featured_media":98,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[31],"class_list":["post-87","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-sql-server","tag-function"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.7 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>End Of Month Function - Suherman Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"http:\/\/suherman.asia\/w2\/end-of-month-function.html\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"End Of Month Function - Suherman Blog\" \/>\n<meta property=\"og:description\" content=\"Gak sengaja lagi buka-buka helpnya SQL Server 2012 kemudian menemukan sebuah function baru dalam pengelolaan tanggal yaitu function End of Month atau ditulis dengan EOMonth() Biasanya kalo kita mau mencari tanggal berapa sebuah bulan berakhir, kita dapat menggunakan cara berikut : DECLARE @DATE DATETIME SET @DATE=&#039;2013-01-17&#039; SELECT CONVERT(VARCHAR(10),DATEADD(ms,-2,DATEADD(MONTH, DATEDIFF(MONTH,0,@DATE)+1,0)),120) AS \u2026 Continue reading\" \/>\n<meta property=\"og:url\" content=\"http:\/\/suherman.asia\/w2\/end-of-month-function.html\" \/>\n<meta property=\"og:site_name\" content=\"Suherman Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/emantin34\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/emantin34\" \/>\n<meta property=\"article:published_time\" content=\"2014-01-02T15:07:38+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2014-03-07T03:29:45+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/suherman.asia\/w2\/wp-content\/uploads\/2014\/01\/month-end1.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"480\" \/>\n\t<meta property=\"og:image:height\" content=\"344\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\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\":\"http:\/\/suherman.asia\/w2\/end-of-month-function.html#article\",\"isPartOf\":{\"@id\":\"http:\/\/suherman.asia\/w2\/end-of-month-function.html\"},\"author\":{\"name\":\"admin\",\"@id\":\"http:\/\/suherman.asia\/w2\/#\/schema\/person\/63654a129ee88012961c1a00415967dc\"},\"headline\":\"End Of Month Function\",\"datePublished\":\"2014-01-02T15:07:38+00:00\",\"dateModified\":\"2014-03-07T03:29:45+00:00\",\"mainEntityOfPage\":{\"@id\":\"http:\/\/suherman.asia\/w2\/end-of-month-function.html\"},\"wordCount\":113,\"commentCount\":0,\"publisher\":{\"@id\":\"http:\/\/suherman.asia\/w2\/#\/schema\/person\/63654a129ee88012961c1a00415967dc\"},\"image\":{\"@id\":\"http:\/\/suherman.asia\/w2\/end-of-month-function.html#primaryimage\"},\"thumbnailUrl\":\"http:\/\/suherman.asia\/w2\/wp-content\/uploads\/2014\/01\/month-end1.jpg\",\"keywords\":[\"Function\"],\"articleSection\":[\"SQL Server\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"http:\/\/suherman.asia\/w2\/end-of-month-function.html#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"http:\/\/suherman.asia\/w2\/end-of-month-function.html\",\"url\":\"http:\/\/suherman.asia\/w2\/end-of-month-function.html\",\"name\":\"End Of Month Function - Suherman Blog\",\"isPartOf\":{\"@id\":\"http:\/\/suherman.asia\/w2\/#website\"},\"primaryImageOfPage\":{\"@id\":\"http:\/\/suherman.asia\/w2\/end-of-month-function.html#primaryimage\"},\"image\":{\"@id\":\"http:\/\/suherman.asia\/w2\/end-of-month-function.html#primaryimage\"},\"thumbnailUrl\":\"http:\/\/suherman.asia\/w2\/wp-content\/uploads\/2014\/01\/month-end1.jpg\",\"datePublished\":\"2014-01-02T15:07:38+00:00\",\"dateModified\":\"2014-03-07T03:29:45+00:00\",\"breadcrumb\":{\"@id\":\"http:\/\/suherman.asia\/w2\/end-of-month-function.html#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"http:\/\/suherman.asia\/w2\/end-of-month-function.html\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"http:\/\/suherman.asia\/w2\/end-of-month-function.html#primaryimage\",\"url\":\"http:\/\/suherman.asia\/w2\/wp-content\/uploads\/2014\/01\/month-end1.jpg\",\"contentUrl\":\"http:\/\/suherman.asia\/w2\/wp-content\/uploads\/2014\/01\/month-end1.jpg\",\"width\":480,\"height\":344},{\"@type\":\"BreadcrumbList\",\"@id\":\"http:\/\/suherman.asia\/w2\/end-of-month-function.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"http:\/\/suherman.asia\/w2\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"End Of Month Function\"}]},{\"@type\":\"WebSite\",\"@id\":\"http:\/\/suherman.asia\/w2\/#website\",\"url\":\"http:\/\/suherman.asia\/w2\/\",\"name\":\"Suherman Blog\",\"description\":\"Just Another Geek Site\",\"publisher\":{\"@id\":\"http:\/\/suherman.asia\/w2\/#\/schema\/person\/63654a129ee88012961c1a00415967dc\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"http:\/\/suherman.asia\/w2\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"http:\/\/suherman.asia\/w2\/#\/schema\/person\/63654a129ee88012961c1a00415967dc\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"http:\/\/suherman.asia\/w2\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/eed6f889b4c2af2a8c18cb3bf63de6a4?s=96&d=retro&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/eed6f889b4c2af2a8c18cb3bf63de6a4?s=96&d=retro&r=g\",\"caption\":\"admin\"},\"logo\":{\"@id\":\"http:\/\/suherman.asia\/w2\/#\/schema\/person\/image\/\"},\"sameAs\":[\"http:\/\/suherman.asia\",\"https:\/\/www.facebook.com\/emantin34\",\"https:\/\/x.com\/emantin34\"],\"url\":\"http:\/\/suherman.asia\/w2\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"End Of Month Function - Suherman Blog","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":"http:\/\/suherman.asia\/w2\/end-of-month-function.html","og_locale":"en_US","og_type":"article","og_title":"End Of Month Function - Suherman Blog","og_description":"Gak sengaja lagi buka-buka helpnya SQL Server 2012 kemudian menemukan sebuah function baru dalam pengelolaan tanggal yaitu function End of Month atau ditulis dengan EOMonth() Biasanya kalo kita mau mencari tanggal berapa sebuah bulan berakhir, kita dapat menggunakan cara berikut : DECLARE @DATE DATETIME SET @DATE='2013-01-17' SELECT CONVERT(VARCHAR(10),DATEADD(ms,-2,DATEADD(MONTH, DATEDIFF(MONTH,0,@DATE)+1,0)),120) AS \u2026 Continue reading","og_url":"http:\/\/suherman.asia\/w2\/end-of-month-function.html","og_site_name":"Suherman Blog","article_publisher":"https:\/\/www.facebook.com\/emantin34","article_author":"https:\/\/www.facebook.com\/emantin34","article_published_time":"2014-01-02T15:07:38+00:00","article_modified_time":"2014-03-07T03:29:45+00:00","og_image":[{"width":480,"height":344,"url":"http:\/\/suherman.asia\/w2\/wp-content\/uploads\/2014\/01\/month-end1.jpg","type":"image\/jpeg"}],"author":"admin","twitter_misc":{"Written by":"admin","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"http:\/\/suherman.asia\/w2\/end-of-month-function.html#article","isPartOf":{"@id":"http:\/\/suherman.asia\/w2\/end-of-month-function.html"},"author":{"name":"admin","@id":"http:\/\/suherman.asia\/w2\/#\/schema\/person\/63654a129ee88012961c1a00415967dc"},"headline":"End Of Month Function","datePublished":"2014-01-02T15:07:38+00:00","dateModified":"2014-03-07T03:29:45+00:00","mainEntityOfPage":{"@id":"http:\/\/suherman.asia\/w2\/end-of-month-function.html"},"wordCount":113,"commentCount":0,"publisher":{"@id":"http:\/\/suherman.asia\/w2\/#\/schema\/person\/63654a129ee88012961c1a00415967dc"},"image":{"@id":"http:\/\/suherman.asia\/w2\/end-of-month-function.html#primaryimage"},"thumbnailUrl":"http:\/\/suherman.asia\/w2\/wp-content\/uploads\/2014\/01\/month-end1.jpg","keywords":["Function"],"articleSection":["SQL Server"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["http:\/\/suherman.asia\/w2\/end-of-month-function.html#respond"]}]},{"@type":"WebPage","@id":"http:\/\/suherman.asia\/w2\/end-of-month-function.html","url":"http:\/\/suherman.asia\/w2\/end-of-month-function.html","name":"End Of Month Function - Suherman Blog","isPartOf":{"@id":"http:\/\/suherman.asia\/w2\/#website"},"primaryImageOfPage":{"@id":"http:\/\/suherman.asia\/w2\/end-of-month-function.html#primaryimage"},"image":{"@id":"http:\/\/suherman.asia\/w2\/end-of-month-function.html#primaryimage"},"thumbnailUrl":"http:\/\/suherman.asia\/w2\/wp-content\/uploads\/2014\/01\/month-end1.jpg","datePublished":"2014-01-02T15:07:38+00:00","dateModified":"2014-03-07T03:29:45+00:00","breadcrumb":{"@id":"http:\/\/suherman.asia\/w2\/end-of-month-function.html#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["http:\/\/suherman.asia\/w2\/end-of-month-function.html"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"http:\/\/suherman.asia\/w2\/end-of-month-function.html#primaryimage","url":"http:\/\/suherman.asia\/w2\/wp-content\/uploads\/2014\/01\/month-end1.jpg","contentUrl":"http:\/\/suherman.asia\/w2\/wp-content\/uploads\/2014\/01\/month-end1.jpg","width":480,"height":344},{"@type":"BreadcrumbList","@id":"http:\/\/suherman.asia\/w2\/end-of-month-function.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"http:\/\/suherman.asia\/w2"},{"@type":"ListItem","position":2,"name":"End Of Month Function"}]},{"@type":"WebSite","@id":"http:\/\/suherman.asia\/w2\/#website","url":"http:\/\/suherman.asia\/w2\/","name":"Suherman Blog","description":"Just Another Geek Site","publisher":{"@id":"http:\/\/suherman.asia\/w2\/#\/schema\/person\/63654a129ee88012961c1a00415967dc"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"http:\/\/suherman.asia\/w2\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"http:\/\/suherman.asia\/w2\/#\/schema\/person\/63654a129ee88012961c1a00415967dc","name":"admin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"http:\/\/suherman.asia\/w2\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/eed6f889b4c2af2a8c18cb3bf63de6a4?s=96&d=retro&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/eed6f889b4c2af2a8c18cb3bf63de6a4?s=96&d=retro&r=g","caption":"admin"},"logo":{"@id":"http:\/\/suherman.asia\/w2\/#\/schema\/person\/image\/"},"sameAs":["http:\/\/suherman.asia","https:\/\/www.facebook.com\/emantin34","https:\/\/x.com\/emantin34"],"url":"http:\/\/suherman.asia\/w2\/author\/admin"}]}},"_links":{"self":[{"href":"http:\/\/suherman.asia\/w2\/wp-json\/wp\/v2\/posts\/87","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/suherman.asia\/w2\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/suherman.asia\/w2\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/suherman.asia\/w2\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/suherman.asia\/w2\/wp-json\/wp\/v2\/comments?post=87"}],"version-history":[{"count":4,"href":"http:\/\/suherman.asia\/w2\/wp-json\/wp\/v2\/posts\/87\/revisions"}],"predecessor-version":[{"id":244,"href":"http:\/\/suherman.asia\/w2\/wp-json\/wp\/v2\/posts\/87\/revisions\/244"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/suherman.asia\/w2\/wp-json\/wp\/v2\/media\/98"}],"wp:attachment":[{"href":"http:\/\/suherman.asia\/w2\/wp-json\/wp\/v2\/media?parent=87"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/suherman.asia\/w2\/wp-json\/wp\/v2\/categories?post=87"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/suherman.asia\/w2\/wp-json\/wp\/v2\/tags?post=87"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}