About 186,000 results
Open links in new tab
  1. Difference of two date time in sql server - Stack Overflow

    Jan 22, 2010 · 20 I can mention four important functions of MS SQL Server that can be very useful: 1) The function DATEDIFF () is responsible to calculate differences between two dates, the result could …

  2. SQL time difference between two dates result in hh:mm:ss

    DateDifference 1 73:12:30 It's also easier to read the result if you add padding so the format is always hh:mm:ss. For example, here's how you would do that in SQL Server 2012 or later:

  3. Time difference with hours, minutes and seconds in SQL Server

    Jan 2, 2017 · Time difference with hours, minutes and seconds in SQL Server Asked 8 years, 11 months ago Modified 2 years, 1 month ago Viewed 31k times

  4. sql server - Date difference in months with decimal - Stack Overflow

    May 28, 2015 · Fractional months make very little, if any, sense since months have variable lengths.

  5. sql server - DATEDIFF Rounding - Database Administrators Stack …

    Aug 27, 2024 · No rounding occurs in this case because the zero maps to an exact date value and the strings are all exactly representable. 3. MishMash = DATEDIFF(DAY, CONVERT(datetime, 0), …

  6. sql server - How do we get an hour, minute and second difference ...

    Mar 9, 2017 · The second parameter of DATEDIFF takes a datetime so your string is implicitly converted to a datetime. In lack of something better to use for a date SQL Server uses 1900-01-01 so your …

  7. sql server - datediff rounding - Stack Overflow

    I have a db table in SQL Server which contains a start date for a project. On a web status page I want to show how many days/weeks/months the project has run, the units depending on the duration. So

  8. SQL Server DATEDIFF round up the YEAR difference. How to round it …

    Feb 8, 2019 · SQL Server DATEDIFF round up the YEAR difference. How to round it down? Asked 6 years, 10 months ago Modified 10 months ago Viewed 13k times

  9. sql server 2008 - DATEADD (MONTH, DATEDIFF (MONTH, 0, GETDATE …

    DATEDIFF(MONTH, 0, '2-14-2015') --returns month. 0 is for 1/1/1900, and getdate is the current date --(i used a set date bc dates will change as this post gets older). result: 1381 In my workings, I used …

  10. sql - Datediff function between a date column and current date?

    How can I correctly calculate the difference in days or years between a date column and the current date? typically would use where date_diff('day, date_column1, date_column2) as difference So...