Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
nuruddean
Starting Member
11 Posts |
Posted - 2010-05-05 : 02:51:20
|
I choose to retire on my 58 age.My date of birth is 10/03/1980I use this script: sysdate + ((58 - round((sysdate - a.date_of_birth)/365,2)) * 365 )the output is 02/25/2038the year is correct but the date is incorrect, it should be 03/10/2038please help me on this matterMy Name is Nuruddin |
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2010-05-05 : 02:52:24
|
select dateadd(yy,58,'19801003') No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2010-05-05 : 02:55:43
|
are you using sql server? sysdate is not in sql server------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
vaibhavktiwari83
Aged Yak Warrior
843 Posts |
Posted - 2010-05-05 : 02:56:31
|
quote: Originally posted by nuruddean I choose to retire on my 58 age.My date of birth is 10/03/1980I use this script: sysdate + ((58 - round((sysdate - a.date_of_birth)/365,2)) * 365 )the output is 02/25/2038the year is correct but the date is incorrect, it should be 03/10/2038please help me on this matterMy Name is Nuruddin
First question is 10/03/1980 is 10th march or 3rd October ?and second one are you using SQL Server?Vaibhav TTo walk FAST walk ALONE To walk FAR walk TOGETHER |
 |
|
nuruddean
Starting Member
11 Posts |
Posted - 2010-05-05 : 03:07:13
|
1) i'm using oracle 2)10th marchMy Name is Nuruddin |
 |
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2010-05-05 : 03:16:03
|
http://www.databasejournal.com/scripts/article.php/3762331/DateAdd-function-Oracle.htm No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
nuruddean
Starting Member
11 Posts |
Posted - 2010-05-05 : 04:23:30
|
ok i found it from other site... i use add_month thank you...My Name is Nuruddin |
 |
|
|
|
|