About 741,000 results
Open links in new tab
  1. sql server - SQL Rounded Months calculations - Stack Overflow

    Jul 21, 2025 · This avoids overestimating or underestimating time, especially when dealing with different month lengths (like February vs. July). Round the result to two decimal places to keep it clean and …

  2. Date Difference Calculations between Excel and SQL Server

    Nov 4, 2015 · 0 I'm using Excel 2013 and SQL Server 2014. I'd like to know why I get two different results when calculating date differences on the same dates: Excel:

  3. sql - How to calculate age (in years) based on Date of Birth and ...

    Oct 15, 2009 · I have a table listing people along with their date of birth (currently a nvarchar(25)) How can I convert that to a date, and then calculate their age in years? My data looks as follows ID Na...

  4. sql server - (Transact-SQL) DATEDIFF and leap years - Stack Overflow

    Jan 2, 2004 · The query (DATEDIFF(DAY,@START_DATE,@END_DATE) / 365) return 10, but the number of correct years is 9. This happens because my query does not consider leap years.

  5. sql - Exclude weekends and custom days (i.e. Holidays) from date ...

    Oct 4, 2013 · Currently, I am calculating a finish date based on the start date (DateTime) and duration (# of days), but my calculations do not take into account weekends or holidays.

  6. SQL Server - calculate elapsed time between two ... - Stack Overflow

    Dec 12, 2012 · SQL Server doesn't support the SQL standard interval data type. Your best bet is to calculate the difference in seconds, and use a function to format the result.

  7. sql - how to find the duration between two dates - Stack Overflow

    Oct 8, 2012 · 4 I want to find the duration between the two date columns. For this i used the DATEDIFF function to find number years and months separately but wanted both results in single column. The …

  8. sql server - SQL Convert string to Date works, but calculations from it ...

    Nov 27, 2019 · SQL Convert string to Date works, but calculations from it does not Asked 6 years ago Modified 5 years, 11 months ago Viewed 961 times

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

    anyone know how to calculate the number of full months in SQL Server?

  10. Find closest earlier date in SQL Server - Stack Overflow

    Dec 24, 2012 · I have a table dbo.X with DateTime column Y which may have hundreds of records. My Stored Procedure has parameter @CurrentDate, I want to find out the date in the column Y in above …