{"id":455,"date":"2013-08-02T07:20:16","date_gmt":"2013-08-02T07:20:16","guid":{"rendered":"http:\/\/ntspl.co.in\/blog\/?p=455"},"modified":"2021-12-20T11:01:29","modified_gmt":"2021-12-20T11:01:29","slug":"find-first-sunday-of-the-month-in-sql-server","status":"publish","type":"post","link":"https:\/\/www.ntspl.co.in\/blog\/find-first-sunday-of-the-month-in-sql-server\/","title":{"rendered":"Find first sunday of the month in SQL Server"},"content":{"rendered":"<p>It required check <strong>Sunday<\/strong> when you generate installment schedule using <strong>Store Procedure.<\/strong><\/p>\n<pre class=\"code-structure\"><code>\r\ndeclare @sun datetime\r\nset @sun=DATEADD(Month, DATEDIFF(Month, 0, GETDATE()) + 0, 0) +\r\n6 - (DATEPART(Weekday,DATEADD(Month,DATEDIFF(Month,0, GETDATE()) + 0, 0))\r\n+ @@DateFirst + 5) % 7\r\n\r\nprint @sun\r\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>It required check Sunday when you generate installment schedule using Store Procedure. declare @sun datetime set @sun=DATEADD(Month, DATEDIFF(Month, 0, GETDATE()) + 0, 0) + 6 &#8211; (DATEPART(Weekday,DATEADD(Month,DATEDIFF(Month,0, GETDATE()) + 0, 0)) + @@DateFirst + 5) % 7 print @sun<\/p>\n","protected":false},"author":18,"featured_media":1497,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[3,30],"tags":[330],"class_list":["post-455","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-asp-dot-net","category-sql-server","tag-sql-server"],"acf":{"custom_meta_title":"Finding First Sunday of the Month in SQL Server | NTSPL","meta_description":"Do you know how to find the first sunday of the month using SQL Server? Get to know the procedure to find the first sunday of the month in SQL Server.","meta_keyword":"finding first sunday, finding first sunday of the month, finding first sunday using sql server","other_meta_tag":"<meta property=og:locale content=\"en-IN\" \/>\r\n<meta property=og:type content=\"website\" \/>\r\n<meta property=og:title content=\"Finding First Sunday of the Month in SQL Server | NTSPL\"\/>\r\n<meta property=og:description content=\"Do you know how to find the first sunday of the month using SQL Server? Get to know the procedure to find the first sunday of the month in SQL Server.\"\/>\r\n<meta property=og:url content=\"https:\/\/www.ntspl.co.in\/blog\/find-first-sunday-of-the-month-in-sql-server\"\/>\r\n<meta property=og:site_name content=NTSPL \/>\r\n<meta name=\"twitter:site\" content=\"@NTSPL\">\r\n<meta name=twitter:card content=\"summary\" \/>\r\n<meta name=twitter:description content=\"Do you know how to find the first sunday of the month using SQL Server? Get to know the procedure to find the first sunday of the month in SQL Server.\"\/>\r\n<meta name=twitter:title content=\"Finding First Sunday of the Month in SQL Server | NTSPL\"\/>"},"_links":{"self":[{"href":"https:\/\/www.ntspl.co.in\/blog\/wp-json\/wp\/v2\/posts\/455"}],"collection":[{"href":"https:\/\/www.ntspl.co.in\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ntspl.co.in\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ntspl.co.in\/blog\/wp-json\/wp\/v2\/users\/18"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ntspl.co.in\/blog\/wp-json\/wp\/v2\/comments?post=455"}],"version-history":[{"count":6,"href":"https:\/\/www.ntspl.co.in\/blog\/wp-json\/wp\/v2\/posts\/455\/revisions"}],"predecessor-version":[{"id":4359,"href":"https:\/\/www.ntspl.co.in\/blog\/wp-json\/wp\/v2\/posts\/455\/revisions\/4359"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.ntspl.co.in\/blog\/wp-json\/wp\/v2\/media\/1497"}],"wp:attachment":[{"href":"https:\/\/www.ntspl.co.in\/blog\/wp-json\/wp\/v2\/media?parent=455"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ntspl.co.in\/blog\/wp-json\/wp\/v2\/categories?post=455"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ntspl.co.in\/blog\/wp-json\/wp\/v2\/tags?post=455"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}