{"id":142,"date":"2023-05-18T11:37:00","date_gmt":"2023-05-18T11:37:00","guid":{"rendered":"https:\/\/datadandies.nl\/?p=142"},"modified":"2023-05-18T11:37:54","modified_gmt":"2023-05-18T11:37:54","slug":"thousand-separators-in-sql","status":"publish","type":"post","link":"https:\/\/datadandies.nl\/index.php\/2023\/05\/18\/thousand-separators-in-sql\/","title":{"rendered":"Thousand separators in SQL\u00a0"},"content":{"rendered":"\n<p>Wil je in SQL Server Management Studio in plaats van 1000000 het volgende zien: 1.000.000,00? De functie FORMAT kan je in zo\u2019n geval van dienst zijn.&nbsp;<\/p>\n\n\n\n<p>Soms is het handig om bij grote getallen scheidingstekens voor duizendtallen te hebben. In zo\u2019n geval kun je gebruik maken van de functie in het onderstaande voorbeeld:&nbsp;&nbsp;<\/p>\n\n\n\n<p>FORMAT(235425612, &#8216;n&#8217;, &#8216;de-de&#8217;)&nbsp;<\/p>\n\n\n\n<p>Bedenk wel dat dit het datatype wijzigt naar NVARCHAR. Ik gebruik dit trucje alleen om in een oogopslag te zien in SSMS om wat voor getallen het nu daadwerkelijk draait als er grote getallen uit een query komen. Wanneer je een export van deze data moet maken voor een eindgebruiker die er vervolgens aggregaties mee gaat doen, is het handiger om de FORMAT functie weer weg te halen.&nbsp;&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"275\" src=\"https:\/\/datadandies.nl\/wp-content\/uploads\/2023\/05\/20230130-SQL-thousand-separator-scheidingsteken-voor-duizendtallen-1024x275.png\" alt=\"\" class=\"wp-image-143\" srcset=\"https:\/\/datadandies.nl\/wp-content\/uploads\/2023\/05\/20230130-SQL-thousand-separator-scheidingsteken-voor-duizendtallen-1024x275.png 1024w, https:\/\/datadandies.nl\/wp-content\/uploads\/2023\/05\/20230130-SQL-thousand-separator-scheidingsteken-voor-duizendtallen-300x81.png 300w, https:\/\/datadandies.nl\/wp-content\/uploads\/2023\/05\/20230130-SQL-thousand-separator-scheidingsteken-voor-duizendtallen-768x207.png 768w, https:\/\/datadandies.nl\/wp-content\/uploads\/2023\/05\/20230130-SQL-thousand-separator-scheidingsteken-voor-duizendtallen-1536x413.png 1536w, https:\/\/datadandies.nl\/wp-content\/uploads\/2023\/05\/20230130-SQL-thousand-separator-scheidingsteken-voor-duizendtallen-2048x551.png 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>Wil je in SQL Server Management Studio in plaats van 1000000 het volgende zien: 1.000.000,00? De functie FORMAT kan je in zo\u2019n geval van dienst zijn.&nbsp; Soms is het handig om bij grote getallen scheidingstekens voor duizendtallen te hebben. In zo\u2019n geval kun je gebruik maken van de functie in het onderstaande voorbeeld:&nbsp;&nbsp; FORMAT(235425612, &#8216;n&#8217;,&hellip;<\/p>\n<p class=\"more-link\"><a href=\"https:\/\/datadandies.nl\/index.php\/2023\/05\/18\/thousand-separators-in-sql\/\" class=\"themebutton\">Read More<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[17,4],"class_list":["post-142","post","type-post","status-publish","format-standard","hentry","category-blog","tag-data","tag-sql"],"_links":{"self":[{"href":"https:\/\/datadandies.nl\/index.php\/wp-json\/wp\/v2\/posts\/142","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/datadandies.nl\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/datadandies.nl\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/datadandies.nl\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/datadandies.nl\/index.php\/wp-json\/wp\/v2\/comments?post=142"}],"version-history":[{"count":1,"href":"https:\/\/datadandies.nl\/index.php\/wp-json\/wp\/v2\/posts\/142\/revisions"}],"predecessor-version":[{"id":144,"href":"https:\/\/datadandies.nl\/index.php\/wp-json\/wp\/v2\/posts\/142\/revisions\/144"}],"wp:attachment":[{"href":"https:\/\/datadandies.nl\/index.php\/wp-json\/wp\/v2\/media?parent=142"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/datadandies.nl\/index.php\/wp-json\/wp\/v2\/categories?post=142"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/datadandies.nl\/index.php\/wp-json\/wp\/v2\/tags?post=142"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}