valeryk2000 (11/18/2013)
So far I checked the code several times - and it was ok. Where is a potential error?
Here's one of many places where it fails because of Leap Years...
DECLARE @dob datetime
,@now datetime
SELECT @dob = '2000-02-28 00:00:00'
,@now = '2001-02-27 00:00:00'
SELECT DATEDIFF(YEAR, '0:0', @now-@dob)
;
--Jeff Moden
Change is inevitable... Change for the better is not.