Results 1 to 2 of 2

Thread: How to determine range of dates?

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2009
    Posts
    3

    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

  2. #2
    Frenzied Member
    Join Date
    Jun 2005
    Posts
    1,950

    Re: How to determine range of dates?

    Code:
           If date1 < date2 And date2 < date3 Then
           'date2 is in between
            End If

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width