views:

83

answers:

1

i have 2 fields in the database (sql server 08) Dob = "05/09/1965" license_age = 16 how do i get the number of years this person hs had licence. so basically dim age1 = current year - (dob - license_age) thanks

-- thanks for the answers. worked perfectly. another question based on this. how do i find out which year he got his license based on the above two fields?

+2  A: 
Dim dob As DateTime = GetDobFromDb()
Dim licAge As Integer = GetLicAgeFromDb()

Dim age1 As TimeSpan = DateTime.Today - dob.AddYears(licAge)
Joel Coehoorn
worked perfectly. another question based on this. how do i find out which year he got his license based on the above two fields?
iregy