Home Forums SQL Server 2005 T-SQL (SS2K5) ROUND() function doesn't round properly RE: ROUND() function doesn't round properly
Dave Ballantyne
SSC-Dedicated
Points: 33566
More actions
October 2, 2009 at 4:16 am
#1060831
Heres how to calculate an age
select CASE
WHEN dateadd(year, datediff (year, d1, d2), d1) > d2
THEN datediff (year, d1, d2) - 1
ELSE datediff (year, d1, d2)
END as Age
I'll take a look at the rounding issue though...