Viewing 2 posts - 1 through 2 (of 2 total)
There are many ways to give the right answer...
Your solution is returning me a star character (*)... A dimension musl be provided to the @result variable declaration: Declare @result VarChar(10)......
July 10, 2008 at 8:49 am
Declare @d smalldatetime
set @d = '1957/7/5'
Select DATEDIFF(yy, @d, GETDATE()) -
CASE WHEN
DATEPART(m, @d) < DATEPART(m, GETDATE())
OR (
DATEPART(m, @d) = DATEPART(m, GETDATE())
AND
DATEPART(d, @d) <= DATEPART(d, GETDATE())
) THEN 0 ELSE...
July 3, 2008 at 7:31 pm
Viewing 2 posts - 1 through 2 (of 2 total)
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