How to determine range of dates?
Hello, how can I determine if a varable called "date1" is within the range of variables "date2" and "date3"?
For example, if date1 is 12/31/1999, and dates 2 and 3 are 12/31/2001 and 12/31/1997 (or the other way around), then first date is between the 2nd and 3rd dates.
Here's the code that I have to calculate the dates so far:
Code:
Dim date1 As Date = CType((date1TextBox.Text), Date)
Dim date2 As Date = CType((date2TextBox.Text), Date)
Dim date3 As Date = CType((date3TextBox.Text), Date)
Thanks in advance
Re: How to determine range of dates?
Code:
If date1 < date2 And date2 < date3 Then
'date2 is in between
End If