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

    Jan 22, 2010 · 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 …

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

    May 10, 2016 · Sql server supports adding and subtracting on Datetime data type, so you can simply do something like this: DECLARE @StartTime datetime = '2016-05-10 02:25:34.000', …

  3. sql server - SQL time difference between two dates result in …

    Oct 1, 2012 · Within a single select statement, I have one column returning a time in the future, a second column is getdate() and a third column uses your logic replacing dt2 and dt1 with the …

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

    May 28, 2015 · Improving a previous answer.. To calculate the number of months it can be divided in three parts. The part of the month from the beginning to the end of the month, the …

  5. sql - Count work days between two dates - Stack Overflow

    May 17, 2013 · For workdays, Monday to Friday, you can do it with a single SELECT, like this: DECLARE @StartDate DATETIME DECLARE @EndDate DATETIME SET @StartDate = …

  6. sql - using DateDiff to find duration in minutes - Stack Overflow

    I am trying to use Datediff to find out the duration between columnA and columnB. SELECT datediff (minute, stime, etime) from Exceptions2 where stime = [exceptions2].starttime and …

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

    Aug 27, 2024 · Here we have DATEDIFF called with an integer and a varchar string as parameters. SQL Server converts both the zero and the dt string to datetime, as you can see …

  8. SQL Server : DATEDIFF not accurate - Stack Overflow

    Nov 5, 2015 · Here is a way to visualize what DATEDIFF(month, ...) is doing. Think of a monthly calendar hanging on the wall. For the purposes of this particular SQL function "number" of …

  9. Calculating number of full months between two dates in SQL

    Apr 16, 2009 · I tried to use DATEDIFF, i.e. SELECT DATEDIFF(MONTH, '2009-04-16', '2009-05-15') but instead of giving me full months between the two date, it gives me the difference of the …

  10. sql server - datediff rounding - Stack Overflow

    Dec 30, 2010 · If you want an actual calendar reckoning of days, weeks and months, I think your best bet is to use NodaTime in a custom CLR SQL Server function. NodaTime is a .NET port …

Refresh