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 |
|
lemondash
Posting Yak Master
159 Posts |
Posted - 2008-08-28 : 06:37:22
|
| Afternoon,Have a small question i have a table which has a date of birth column but next to it i would like to have another column which has the age in years to the current date. Is there way i can store the data in the colunm so when ever a select or insert statment is run is has the correct data in there. In way where it is like a self calc colunm.Hope that is teh right way to explain it.Regards Lee |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2008-08-28 : 06:43:53
|
[code]select age = datediff(year, dob, getdate()), dobfrom yourtable[/code] KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
|
|
|
|
|