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: 33667
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...
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy