Viewing 15 posts - 25,981 through 25,995 (of 59,099 total)
hariharannkl (9/7/2013)
(DATEDIFF(YY,DOB,GETDATE()) - CASE
WHEN MONTH(DOB)<MONTH(GETDATE()) AND (MONTH(DOB)=MONTH(GETDATE()) OR DAY(DOB)>DAY(GETDATE())) THEN 0 ELSE 1
END)
Here DOB is Columname, and GETDATE() is...
--Jeff Moden
Change is inevitable... Change for the better is not.
September 7, 2013 at 4:03 pm
math martinez (11/16/2012)
SO HERE ARE THE QUERYDECLARE @DOB SMALLDATETIME
SELECT @DOB = '11/15/1987'
SELECT
CASE
WHEN MONTH(@DOB) >= MONTH(GETDATE()) AND DAY(@DOB) >=DAY(GETDATE()) THEN DATEDIFF(YY,@DOB,GETDATE())
ELSE DATEDIFF(YY,@DOB,GETDATE())-1
END AS AGE
HOPE I CAN HELP! 🙂
It...
--Jeff Moden
Change is inevitable... Change for the better is not.
September 7, 2013 at 3:59 pm
If you believe that people that were born on the last day of February on a leap year turn a year older on the last day of February on non-leap...
--Jeff Moden
Change is inevitable... Change for the better is not.
September 7, 2013 at 3:52 pm
Garadin (1/10/2009)
DECLARE @DOB datetimeSET @DOB = '1/20/1980'
SELECT CASE
WHEN DATEPART(DY,GETDATE()) >= DATEPART(DY,@DOB)
THEN DATEDIFF(YY,@DOB,GETDATE())
ELSE DATEDIFF(YY,@DOB,GETDATE())-1
END
Oh, be careful now. I know this is an old post but the code above doesn't...
--Jeff Moden
Change is inevitable... Change for the better is not.
September 7, 2013 at 3:29 pm
What is the datatype for Z.ExpYear and YD.Year?
Also, since you're relatively new to these forums, see the first "Helpful Link" in my signature line below for how to get better...
--Jeff Moden
Change is inevitable... Change for the better is not.
September 7, 2013 at 3:16 pm
C.K.Shaiju (9/4/2013)
Hi Guys,Would you please provide some links or books details to learn to become Database Architect.
Sure... best link for this type of thing in the world.
--Jeff Moden
Change is inevitable... Change for the better is not.
September 7, 2013 at 3:04 pm
Hugo Kornelis (9/6/2013)
Jeff Moden (9/6/2013)
First and semantically speaking, using ROW_NUMBER() isn't the same as an actually Tally Table.
I completely agree with this....
Second, if you don't think the "physical"...
--Jeff Moden
Change is inevitable... Change for the better is not.
September 7, 2013 at 11:49 am
SQLRNNR (9/6/2013)
Steve Jones - SSC Editor (9/6/2013)
Jeff Moden (9/5/2013)
Steve Jones - SSC Editor (9/5/2013)
http://www.liveleak.com/view?i=424_1378224156Let's stick Jeff in this interview 😉
BWAAA-HAAAA!!!! Don't forget... I take porkchops to interviews, as well....
--Jeff Moden
Change is inevitable... Change for the better is not.
September 6, 2013 at 9:22 am
Mark, meet Sean. Sean, meet mark. 🙂
Mark... you're on. 🙂
--Jeff Moden
Change is inevitable... Change for the better is not.
September 6, 2013 at 9:12 am
gitmo (9/6/2013)
--Jeff Moden
Change is inevitable... Change for the better is not.
September 6, 2013 at 9:09 am
Sean Lange (9/6/2013)
--Jeff Moden
Change is inevitable... Change for the better is not.
September 6, 2013 at 9:08 am
sknox (9/3/2013)
See the problem? They imply that a tally table has to be intrinsically ordered -- this is simply untrue. A tally table simply has to be orderable.
So even...
--Jeff Moden
Change is inevitable... Change for the better is not.
September 6, 2013 at 6:33 am
Damn. I forgot all about this. I'll get started early next week. According to what Steve asked for in his OP, I'm thinking that I might be...
--Jeff Moden
Change is inevitable... Change for the better is not.
September 5, 2013 at 8:06 pm
In that case, I think Mark should write it and Sean, being a new member of the 10K club, should review it and help guide Mark to his first "Spackle"...
--Jeff Moden
Change is inevitable... Change for the better is not.
September 5, 2013 at 7:56 pm
Based on people's fine suggestions over the last 6 years, there are some things I need to add to this article. Since I'm great as misplacing things, here's the...
--Jeff Moden
Change is inevitable... Change for the better is not.
September 5, 2013 at 7:29 pm
Viewing 15 posts - 25,981 through 25,995 (of 59,099 total)