Check if date dd/MM is in interval without yyyy

grmotild

New member
Joined
Jun 24, 2009
Messages
2
Programming Experience
5-10
Hello.
Will appreciated for any help in VB.NET.
I need to check my field in format ddMMyyyy(ex 12/03/1990) whether in interval of two dates that user picks from

two date picker controls. Two date pickers are in custom format dd/MM. It does not matter for me if its between

particular years. I need just to know if given Birthday belongs to interval taken from screen. Each datepicker gives

values dd/mm/yyyy. I do not know how to check it. For example:
Given date 12/03/1990 . User select two values from screen: From 01/01/1950 Upto 30/04/1949(or 1990, or 2000)
Result should be True.Because 12 march is between 01 Januar and 30 April.

Thank you in advance
Michael G.
 
VB.NET:
If yourDate.Month >= Me.DateTimePicker1.Value.Month AndAlso yourDate.Month =< Me.DateTimePicker2.Value.Month Then
      If yourDate.Day >= Me.DateTimePicker1.Value.Day AndAlso yourDate.Day =< Me.DateTimePicker2.Value.Day Then
            'do something
      End If
End If

Bobby
 
Back
Top