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 |
|
omega1983
Starting Member
40 Posts |
Posted - 2009-12-07 : 12:41:32
|
| I have a birthdate in the following formatbirthmonth(char(2)birthday char(2)birthyear char(4)Our database shows these three as text instead of datetime.Two objectives:I want to concatenate the three birth fields so they display like thismm/dd/yyyy (01/01/1985)I also want to use the above date format to calculate the present age of the person. For example if the birthday is 12/1/1985, they just turned 24. If their birthday is 12/24/1985 they turn 24 on the 24th.Is there a way to do this in SQL. So the final results look like thisID NAME birthday age12 Johnson 12/1/1985 2413 Smith 12/24/1985 23 |
|
|
X002548
Not Just a Number
15586 Posts |
|
|
vijayisonly
Master Smack Fu Yak Hacker
1836 Posts |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
|
|
|
|
|