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 |
jassie
Constraint Violating Yak Guru
332 Posts |
Posted - 2014-08-31 : 23:28:56
|
In a sql server 2012 database, I have a field called date of birth that is stored in a tha thatis stored in a datetime format. I need to determine the age of various students in the school system. Thus can you show me sql to that I can use to determine the a child is currently? |
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2014-09-01 : 03:50:39
|
[code]select age = datediff(year, [date of birth], getdate())from yourtable[/code] KH[spoiler]Time is always against us[/spoiler] |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
|
smith_peter_uk
Starting Member
1 Post |
Posted - 2014-09-07 : 11:36:17
|
Calculate age in year, month and days. Check this link:http://subnol.blogspot.com/2014/09/how-to-calculate-age-in-sql-server.html |
|
|
|
|
|