Calculating number of days between a date and today in SQL Server?

Ram Singh picture Ram Singh · Jul 8, 2012 · Viewed 17.1k times · Source

I want to calculate number of days from a date.

For example, we have @date='03/16/2012'. I want to get number of days up to now.

How can I do it?

Answer

Mikael Eriksson picture Mikael Eriksson · Jul 8, 2012
datediff(day, @date, getdate())

datediff