How do I write a trigger to calculate an age in years, based of the date of birth in the same table.
Posted on 2011-09-18
I have a database named FosterKids
I have a table called dbo.tbl_Basic_Info
I have two Columns DOB (datetime, null)
Age (smallint, null)
What I want to do is create a trigger that when the DOB is keyed the database will calculate and save the age in years.
What's the coding that needs to be written? Is there alternative I'm not considering, if their is an alternative where, how, and what do I do?