January 25, 2006 09:25 PM
Correctly Calculating Datetime Differences
Transcend DATEDIFF()’s limitations
Rating:

(0)
SQL Server Magazine
InstantDoc ID #48764
T -SQL programmers share a basic and surprisingly challenging problem: correctly calculating the difference between two datetime values. SQL Server doesn't provide a built-in solution for this task, so you have to create your own.
Although SQL Server's DATEDIFF() function lets you calculate the difference between two datetime values in terms of a specified unit (e.g., year, month, day), DATE DIFF() considers only the specified unit and those higher in the temporal hierarchy— not low...
...This article is for paid Professional Members only.
Already a Professional Member? Please log in now: