开发者

add number to date field in vb.net

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?


Dim dob As DateTime = GetDobFromDb()
Dim licAge As Integer = GetLicAgeFromDb()

Dim age1 As TimeSpan = DateTime.Today - dob.AddYears(licAge)
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜