About 53 results
Open links in new tab
  1. Calculate exact date difference in years using SQL

    select *, DATEDIFF (yy, Begin_date, GETDATE()) AS 'Age in Years' from Report_Stage; The 'Age_In_Years' column is being rounded. How do I get the exact date in years?

  2. Difference of two date time in sql server - Stack Overflow

    Jan 22, 2010 · Is there any way to take the difference between two datetime in sql server? For example, my dates are 2010-01-22 15:29:55.090 2010-01-22 15:30:09.153 So, the result should be 14.063 …

  3. sql - Diferença entre duas datas em dias, horas, minutos e segundos ...

    Jun 7, 2015 · Problema: Como realizar a subtração entre duas datas e retornar o valor em Dias, Horas, Minutos e Segundos em uma consulta SQL com SQL Server 2014? Exemplo: Dados: …

  4. sql - Date Difference between consecutive rows - Stack Overflow

    1001 10/9/2011 - 12/9/2011 2 days 1001 12/9/2011 - 20/9/2011 8 days 1001 20/9/2011 NA Basically what i would like to do is have an access query that calculates the date difference for consecutive …

  5. sql - Using GETDATE WITH DATEDIFF? - Stack Overflow

    Mar 24, 2017 · It counts the number of year boundaries between two dates. So, the difference between Jan 1 20015 and Dec 31 2016 is 1 year. In addition, with DATEDIFF() the column is an argument to …

  6. datediff - Difference between two date& time in datetime Fields in SQL ...

    Jun 24, 2013 · Closed 13 years ago. Possible Duplicate: How to compare two dates to find time difference in SQL Server 2005, date manipulation I had two datetime fields and should calculate the …

  7. sql - How to use DATEDIFF to return year, month and day ... - Stack ...

    Oct 9, 2009 · How can I use DATEDIFF to return the difference between two dates in years, months and days in SQL Server 2005 DATEDIFF (date , date) How to result that: 2 year 3 month 10 day Can …

  8. sql - Dynamic DatePart when using DateDiff - Stack Overflow

    The only thing you can really do aside from the suggested dynamic sql or case statement is to always do the datediff at a granular DatePart and then upconvert. This isn't fool proof though, you will get an …

  9. SQL Datediff - find datediff between rows - Stack Overflow

    Apr 20, 2011 · I would like to query a database using sql to show the difference in time between id 1,2,3 and so on. basically it will compare the row below it for all records. any help would be appreciated. ID...

  10. sql - DATEDIFF function in Oracle - Stack Overflow

    Feb 9, 2015 · I need to use Oracle but DATEDIFF function doesn't work in Oracle DB. How to write the following code in Oracle? I saw some examples using INTERVAL or TRUNC. SELECT DATEDIFF …