hi..
can u help me calculate age using vb.net.
i have txtage.text and txtdob.text.
the format dob is 21.03.1978.
and if txtage.text <35 it will in group 1, if txtage.text < 49 it will in group 2. the group in radiobutton. i've bee thinking this problem almost 3 days. please anyone out there help me.
Check out the books online entries for the DateDiff function and DatePart funciton.
The DateDiff will give you the number of years in between, but you'll need to use some logic to determine if the current year should be counted because it's not a whole year.
Private Sub DateTimePicker1_ValueChanged(sender As System.Object, e As System.EventArgs) Handles DateTimePicker1.ValueChanged
TextBox5.Text = DateTimePicker1.Value
TextBox9.Text = CInt(DateDiff(DateInterval.Day, CDate(TextBox5.Text), CDate(Now)) / 365)
End Sub