{"id":11635,"date":"2018-08-31T13:27:15","date_gmt":"2018-08-31T11:27:15","guid":{"rendered":"https:\/\/www.dbi-services.com\/blog\/sql-server-tips-how-many-different-datetime-are-in-my-column-and-what-the-delta\/"},"modified":"2018-08-31T13:27:15","modified_gmt":"2018-08-31T11:27:15","slug":"sql-server-tips-how-many-different-datetime-are-in-my-column-and-what-the-delta","status":"publish","type":"post","link":"https:\/\/www.dbi-services.com\/blog\/sql-server-tips-how-many-different-datetime-are-in-my-column-and-what-the-delta\/","title":{"rendered":"SQL Server Tips: How many different datetime are in my column and what the delta?"},"content":{"rendered":"<p>Few months ago, a customer asks me for finding in a column, how many rows exist with the same date &amp; time and the delta between them. The column default value \u00a0is based on the function <a title=\"MSDN to CURRENT_TIMESTAMP\" href=\"https:\/\/docs.microsoft.com\/en-us\/sql\/t-sql\/functions\/current-timestamp-transact-sql?view=sql-server-2017\" target=\"_blank\">CURRENT_TIMESTAMP<\/a> and used as key as well.<br \/>\n<em>This is obviously a very bad idea but let\u2019s go ahead&#8230;<\/em><\/p>\n<p>This anti pattern may lead to a lot of duplicate keys and the customer wanted to get a picture of the situation.<\/p>\n<p>To perform this task, I used the following example which includes a temporary\u00a0table with one column with a datetime format:<\/p>\n<pre class=\"brush: sql; gutter: true; first-line: 1\">CREATE TABLE [#tmp_time_count] (dt datetime not null)<\/pre>\n<p>Let\u2019s insert a bunch a rows with CURRENT_TIMESTAMP function in the temporary table:<\/p>\n<pre class=\"brush: sql; gutter: true; first-line: 1\">INSERT INTO [#tmp_time_count] SELECT CURRENT_TIMESTAMP\nGo 1000\n<\/pre>\n<p>To get distinct datetime values , I used DISCTINCT and COUNT functions as follows:<\/p>\n<pre class=\"brush: sql; gutter: true; first-line: 1\">SELECT COUNT(DISTINCT dt) as [number_of_time_diff] from [#tmp_time_count]<\/pre>\n<p><a href=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/datetime_diff_01.png\"><img loading=\"lazy\" decoding=\"async\" class=\" size-medium wp-image-27602 aligncenter\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/datetime_diff_01.png\" alt=\"datetime_diff_01\" width=\"300\" height=\"122\" \/><\/a><br \/>\nIn my test, I find 36 different times for 1000 rows.<br \/>\nThe question now is to know how many I have on the same date &amp; time&#8230;<br \/>\nTo have this information, I try a lot of thing but finally, I write this query with a LEFT JOIN on the same table and a DATEPART on the datetime\u2019s column.<\/p>\n<pre class=\"brush: sql; gutter: true; first-line: 1\">SELECT DISTINCT [current].dt as [Date&amp;Time], DATEPART(MILLISECOND,ISNULL([next].dt,0) \u2013[current].dt) as [time_diff] FROM [#tmp_time_count] as [current] LEFT JOIN [#tmp_time_count] as [next] on [next].dt = (SELECT MIN(dt) FROM [#tmp_time_count] WHERE dt &gt;[current].dt)<\/pre>\n<p><a href=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/datetime_diff_02.png\"><img loading=\"lazy\" decoding=\"async\" class=\" size-medium wp-image-27601 aligncenter\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/datetime_diff_02.png\" alt=\"datetime_diff_02\" width=\"300\" height=\"160\" \/><\/a><br \/>\nFinally, don\u2019t forget to drop the temporary table&#8230;.<\/p>\n<pre class=\"brush: sql; gutter: true; first-line: 1\">DROP TABLE [#tmp_time_count];<\/pre>\n<p>Et voila! I hope this above\u00a0query will help you in a similar situation&#8230; But it&#8217;s not finished!<\/p>\n<p>Having discussed this blog post with my colleague <a title=\"David Barbarin\" href=\"https:\/\/www.dbi-services.com\/blog\/author\/david-barbarin\/\" target=\"_blank\">David Barbarin<\/a>, he suggested I continue to dig further with the performance aspect by inserting more rows (let\u2019s say 100000 rows as new exemple for this blog post).<br \/>\nlet\u2019s go!<br \/>\nTo perform this test, I enabled STATISTICS TIME &amp; IO options to get a picture of query execution statistics for each test.<\/p>\n<pre class=\"brush: sql; gutter: true; first-line: 1\">SET STATISTICS TIME ON \nGO\nSET STATISTICS IO ON \nGO\n<\/pre>\n<p><a href=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/datetime_rw01.png\"><img loading=\"lazy\" decoding=\"async\" class=\" size-medium wp-image-28402 aligncenter\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/datetime_rw01.png\" alt=\"datetime_rw01\" width=\"300\" height=\"167\" \/><\/a><\/p>\n<p>As you can see on the screenshot, the CPU time is 95875ms with an number of 1322685 logical reads.<br \/>\nThis is the first step to the optimization process. I added then the following non-clustered Index:<\/p>\n<pre class=\"brush: sql; gutter: true; first-line: 1\">CREATE NONCLUSTERED INDEX [dt_idx] ON [dbo].[#tmp_time_count]\n(\n\t[dt] ASC\n)\nGO<\/pre>\n<p><a href=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/datetime_rw02.png\"><img loading=\"lazy\" decoding=\"async\" class=\" size-medium wp-image-28403 aligncenter\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/datetime_rw02.png\" alt=\"datetime_rw02\" width=\"300\" height=\"184\" \/><\/a><br \/>\nAfter the query execution, the new result is very better, because the CPU time dropped to 624ms with a number of logical reads equals to 205223.<br \/>\nAdding an index was helpful to get a better result but the query execution time is still tied to the number of rows in the table<br \/>\nTo get a more consistent result , David proposed one another possible solution including the <a title=\"LEAD function\" href=\"https:\/\/docs.microsoft.com\/en-us\/sql\/t-sql\/functions\/lead-transact-sql?view=sql-server-2017\" target=\"_blank\">LEAD function<\/a> started since SQL Server 2012.<br \/>\nThe new query becomes:<\/p>\n<pre class=\"brush: sql; gutter: true; first-line: 1\">SELECT [current].dt, DATEPART(MILLISECOND, LEAD([current].dt, 1, 0) OVER (ORDER BY [current].dt) - [current].dt) AS [time_diff]\nFROM  [#tmp_time_count] AS [current]\n<\/pre>\n<p><a href=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/datetime_rw03.png\"><img loading=\"lazy\" decoding=\"async\" class=\" size-medium wp-image-28404 aligncenter\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/datetime_rw03.png\" alt=\"datetime_rw03\" width=\"300\" height=\"179\" \/><\/a><\/p>\n<p>After running the query, CPU Time is 94ms with a number of logical reads equals to 282.<br \/>\nI was very impressed by the result with just the creation of an index and the use of the Lead function as well.<br \/>\nSo, if you face a similar situation with a high volume of data, prefer working with this last query.<br \/>\nIt was also a good reminder to have a look at the new T-SQL functions shipped with SQL Server to get faster.<br \/>\nThank you David to challenge me on this topic!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Few months ago, a customer asks me for finding in a column, how many rows exist with the same date &amp; time and the delta between them. The column default value \u00a0is based on the function CURRENT_TIMESTAMP and used as key as well. This is obviously a very bad idea but let\u2019s go ahead&#8230; This [&hellip;]<\/p>\n","protected":false},"author":15,"featured_media":11637,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[198,368,99],"tags":[49,51,44],"type_dbi":[],"class_list":["post-11635","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-database-management","category-development-performance","category-sql-server","tag-microsoft","tag-sql-server","tag-troubleshooting"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.2 (Yoast SEO v27.4) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>SQL Server Tips: How many different datetime are in my column and what the delta? - dbi 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=\"https:\/\/www.dbi-services.com\/blog\/sql-server-tips-how-many-different-datetime-are-in-my-column-and-what-the-delta\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"SQL Server Tips: How many different datetime are in my column and what the delta?\" \/>\n<meta property=\"og:description\" content=\"Few months ago, a customer asks me for finding in a column, how many rows exist with the same date &amp; time and the delta between them. The column default value \u00a0is based on the function CURRENT_TIMESTAMP and used as key as well. This is obviously a very bad idea but let\u2019s go ahead&#8230; This [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.dbi-services.com\/blog\/sql-server-tips-how-many-different-datetime-are-in-my-column-and-what-the-delta\/\" \/>\n<meta property=\"og:site_name\" content=\"dbi Blog\" \/>\n<meta property=\"article:published_time\" content=\"2018-08-31T11:27:15+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/datetime_diff_02.png\" \/>\n\t<meta property=\"og:image:width\" content=\"2558\" \/>\n\t<meta property=\"og:image:height\" content=\"1368\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"St\u00e9phane Haby\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"St\u00e9phane Haby\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/sql-server-tips-how-many-different-datetime-are-in-my-column-and-what-the-delta\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/sql-server-tips-how-many-different-datetime-are-in-my-column-and-what-the-delta\\\/\"},\"author\":{\"name\":\"St\u00e9phane Haby\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0bfb7484ae81c8980fc2b11334f803b\"},\"headline\":\"SQL Server Tips: How many different datetime are in my column and what the delta?\",\"datePublished\":\"2018-08-31T11:27:15+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/sql-server-tips-how-many-different-datetime-are-in-my-column-and-what-the-delta\\\/\"},\"wordCount\":486,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/sql-server-tips-how-many-different-datetime-are-in-my-column-and-what-the-delta\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2022\\\/04\\\/datetime_diff_02.png\",\"keywords\":[\"Microsoft\",\"SQL Server\",\"Troubleshooting\"],\"articleSection\":[\"Database management\",\"Development &amp; Performance\",\"SQL Server\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/sql-server-tips-how-many-different-datetime-are-in-my-column-and-what-the-delta\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/sql-server-tips-how-many-different-datetime-are-in-my-column-and-what-the-delta\\\/\",\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/sql-server-tips-how-many-different-datetime-are-in-my-column-and-what-the-delta\\\/\",\"name\":\"SQL Server Tips: How many different datetime are in my column and what the delta? - dbi Blog\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/sql-server-tips-how-many-different-datetime-are-in-my-column-and-what-the-delta\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/sql-server-tips-how-many-different-datetime-are-in-my-column-and-what-the-delta\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2022\\\/04\\\/datetime_diff_02.png\",\"datePublished\":\"2018-08-31T11:27:15+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0bfb7484ae81c8980fc2b11334f803b\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/sql-server-tips-how-many-different-datetime-are-in-my-column-and-what-the-delta\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/sql-server-tips-how-many-different-datetime-are-in-my-column-and-what-the-delta\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/sql-server-tips-how-many-different-datetime-are-in-my-column-and-what-the-delta\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2022\\\/04\\\/datetime_diff_02.png\",\"contentUrl\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2022\\\/04\\\/datetime_diff_02.png\",\"width\":2558,\"height\":1368},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/sql-server-tips-how-many-different-datetime-are-in-my-column-and-what-the-delta\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Accueil\",\"item\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"SQL Server Tips: How many different datetime are in my column and what the delta?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/\",\"name\":\"dbi Blog\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0bfb7484ae81c8980fc2b11334f803b\",\"name\":\"St\u00e9phane Haby\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/1123227ca39a5dca608c0f72d23cd1904fee29979749bbb3a485b9438436c553?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/1123227ca39a5dca608c0f72d23cd1904fee29979749bbb3a485b9438436c553?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/1123227ca39a5dca608c0f72d23cd1904fee29979749bbb3a485b9438436c553?s=96&d=mm&r=g\",\"caption\":\"St\u00e9phane Haby\"},\"description\":\"St\u00e9phane Haby has more than ten years of experience in Microsoft solutions. He is specialized in SQL Server technologies such as installation, migration, best practices, and performance analysis etc. He is also an expert in Microsoft Business Intelligence solutions such as SharePoint, SQL Server and Office. Futhermore, he has many years of .NET development experience in the banking sector and other industries. In France, he was one of the first people to have worked with Microsoft Team System. He has written several technical articles on this subject. St\u00e9phane Haby is Microsoft Most Valuable Professional (MVP) as well as Microsoft Certified Solutions Associate (MCSA) and\u00a0Microsoft Certified Solutions Expert (MCSE) for SQL Server 2012. He is also Microsoft Certified Technology Specialist (MCTS) and Microsoft Certified IT Professional (MCITP) for SQL Server 2008 as well as ITIL Foundation V3 certified. He holds a Engineer diploma in industrial computing and automation from France. His branch-related experience covers Chemicals &amp; Pharmaceuticals, Banking \\\/ Financial Services, and many other industries.\",\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/author\\\/stephane-haby\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"SQL Server Tips: How many different datetime are in my column and what the delta? - dbi 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":"https:\/\/www.dbi-services.com\/blog\/sql-server-tips-how-many-different-datetime-are-in-my-column-and-what-the-delta\/","og_locale":"en_US","og_type":"article","og_title":"SQL Server Tips: How many different datetime are in my column and what the delta?","og_description":"Few months ago, a customer asks me for finding in a column, how many rows exist with the same date &amp; time and the delta between them. The column default value \u00a0is based on the function CURRENT_TIMESTAMP and used as key as well. This is obviously a very bad idea but let\u2019s go ahead&#8230; This [&hellip;]","og_url":"https:\/\/www.dbi-services.com\/blog\/sql-server-tips-how-many-different-datetime-are-in-my-column-and-what-the-delta\/","og_site_name":"dbi Blog","article_published_time":"2018-08-31T11:27:15+00:00","og_image":[{"width":2558,"height":1368,"url":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/datetime_diff_02.png","type":"image\/png"}],"author":"St\u00e9phane Haby","twitter_card":"summary_large_image","twitter_misc":{"Written by":"St\u00e9phane Haby","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.dbi-services.com\/blog\/sql-server-tips-how-many-different-datetime-are-in-my-column-and-what-the-delta\/#article","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/sql-server-tips-how-many-different-datetime-are-in-my-column-and-what-the-delta\/"},"author":{"name":"St\u00e9phane Haby","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/d0bfb7484ae81c8980fc2b11334f803b"},"headline":"SQL Server Tips: How many different datetime are in my column and what the delta?","datePublished":"2018-08-31T11:27:15+00:00","mainEntityOfPage":{"@id":"https:\/\/www.dbi-services.com\/blog\/sql-server-tips-how-many-different-datetime-are-in-my-column-and-what-the-delta\/"},"wordCount":486,"commentCount":0,"image":{"@id":"https:\/\/www.dbi-services.com\/blog\/sql-server-tips-how-many-different-datetime-are-in-my-column-and-what-the-delta\/#primaryimage"},"thumbnailUrl":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/datetime_diff_02.png","keywords":["Microsoft","SQL Server","Troubleshooting"],"articleSection":["Database management","Development &amp; Performance","SQL Server"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.dbi-services.com\/blog\/sql-server-tips-how-many-different-datetime-are-in-my-column-and-what-the-delta\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.dbi-services.com\/blog\/sql-server-tips-how-many-different-datetime-are-in-my-column-and-what-the-delta\/","url":"https:\/\/www.dbi-services.com\/blog\/sql-server-tips-how-many-different-datetime-are-in-my-column-and-what-the-delta\/","name":"SQL Server Tips: How many different datetime are in my column and what the delta? - dbi Blog","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.dbi-services.com\/blog\/sql-server-tips-how-many-different-datetime-are-in-my-column-and-what-the-delta\/#primaryimage"},"image":{"@id":"https:\/\/www.dbi-services.com\/blog\/sql-server-tips-how-many-different-datetime-are-in-my-column-and-what-the-delta\/#primaryimage"},"thumbnailUrl":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/datetime_diff_02.png","datePublished":"2018-08-31T11:27:15+00:00","author":{"@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/d0bfb7484ae81c8980fc2b11334f803b"},"breadcrumb":{"@id":"https:\/\/www.dbi-services.com\/blog\/sql-server-tips-how-many-different-datetime-are-in-my-column-and-what-the-delta\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.dbi-services.com\/blog\/sql-server-tips-how-many-different-datetime-are-in-my-column-and-what-the-delta\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.dbi-services.com\/blog\/sql-server-tips-how-many-different-datetime-are-in-my-column-and-what-the-delta\/#primaryimage","url":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/datetime_diff_02.png","contentUrl":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/datetime_diff_02.png","width":2558,"height":1368},{"@type":"BreadcrumbList","@id":"https:\/\/www.dbi-services.com\/blog\/sql-server-tips-how-many-different-datetime-are-in-my-column-and-what-the-delta\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Accueil","item":"https:\/\/www.dbi-services.com\/blog\/"},{"@type":"ListItem","position":2,"name":"SQL Server Tips: How many different datetime are in my column and what the delta?"}]},{"@type":"WebSite","@id":"https:\/\/www.dbi-services.com\/blog\/#website","url":"https:\/\/www.dbi-services.com\/blog\/","name":"dbi Blog","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.dbi-services.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/d0bfb7484ae81c8980fc2b11334f803b","name":"St\u00e9phane Haby","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/1123227ca39a5dca608c0f72d23cd1904fee29979749bbb3a485b9438436c553?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/1123227ca39a5dca608c0f72d23cd1904fee29979749bbb3a485b9438436c553?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/1123227ca39a5dca608c0f72d23cd1904fee29979749bbb3a485b9438436c553?s=96&d=mm&r=g","caption":"St\u00e9phane Haby"},"description":"St\u00e9phane Haby has more than ten years of experience in Microsoft solutions. He is specialized in SQL Server technologies such as installation, migration, best practices, and performance analysis etc. He is also an expert in Microsoft Business Intelligence solutions such as SharePoint, SQL Server and Office. Futhermore, he has many years of .NET development experience in the banking sector and other industries. In France, he was one of the first people to have worked with Microsoft Team System. He has written several technical articles on this subject. St\u00e9phane Haby is Microsoft Most Valuable Professional (MVP) as well as Microsoft Certified Solutions Associate (MCSA) and\u00a0Microsoft Certified Solutions Expert (MCSE) for SQL Server 2012. He is also Microsoft Certified Technology Specialist (MCTS) and Microsoft Certified IT Professional (MCITP) for SQL Server 2008 as well as ITIL Foundation V3 certified. He holds a Engineer diploma in industrial computing and automation from France. His branch-related experience covers Chemicals &amp; Pharmaceuticals, Banking \/ Financial Services, and many other industries.","url":"https:\/\/www.dbi-services.com\/blog\/author\/stephane-haby\/"}]}},"_links":{"self":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/11635","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/users\/15"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/comments?post=11635"}],"version-history":[{"count":0,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/11635\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/media\/11637"}],"wp:attachment":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/media?parent=11635"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/categories?post=11635"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/tags?post=11635"},{"taxonomy":"type","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/type_dbi?post=11635"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}