About 17,100 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. How to calculate DATE Difference in PostgreSQL? - Stack Overflow

    Here I need to calculate the difference of the two dates in the PostgreSQL. Like we do in SQL Server its much easier. DATEDIFF(Day, MIN(joindate), MAX(joindate)) AS DateDifference; I …

  3. Why does datediff return 1 day less than the actual difference?

    Sep 22, 2014 · Datediff returns the number of borders passed between one value and another; in the case of days, think of the function as counting midnights. If you want to your query to …

  4. How to use DATEDIFF to return year, month and day?

    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 …

  5. How to cast the interval of DateDiff function of the SQL in to …

    Aug 21, 2013 · As pointed out in the comments DATEDIFF returns an INT value of the difference of both dates. Since DATETIME is based on 1900-01-01 being the "base date" meaning …

  6. SQL DateDifference in a where clause - Stack Overflow

    DateDiff is extremely fast... Your problem is you are running it on the database table column value, so the query processor must run the function on every row in the table, even if there …

  7. Include Start Date and the End Date in DateDiff function

    DATEDIFF(DAY, '8/4/2014', '8/5/2014') +1 You need to add 1 to the DATEDIFF function and it will work as you want. Also to note that: DATEDIFF. Returns the count (signed integer) of the …

  8. sql - DATEDIFF function in Oracle - Stack Overflow

    Jan 1, 2000 · 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. …

  9. t sql - How to calculate difference in hours (decimal) between two ...

    DATEDIFF(hour, start_date, end_date) will give you the number of hour boundaries crossed between start_date and end_date. If you need the number of fractional hours, you can use …

  10. Calculate exact date difference in years using SQL

    I extract and transform some of that data to load it somewhere else. One thing I need to do is a DATEDIFF but the year needs to be exact (i.e., 4.6 years instead of rounding up to five years. …

Refresh