Results 1 to 9 of 9

Thread: Compare Dates [resolved]

Threaded View

  1. #1

    Thread Starter
    Fanatic Member demotivater's Avatar
    Join Date
    Jun 2002
    Location
    is everything
    Posts
    627

    Compare Dates [resolved]

    What's the best way to check if one date is greater than another? I have two textboxes with dates in them, want to make sure one of the dates is not greater than the other. The below works sometimes, but I just ran into a case where it isn't working.

    VB Code:
    1. If txtBidDate.text <> "" Then
    2.                         If txtReviewDate.text > txtBidDate.text Then
    3.                             MsgBox "The review date cannot be past the bid date", vbCritical, "Error"
    4.                             txtReviewDate.text = ""
    5.                             cmdReviewDate.SetFocus
    6.                             Exit Sub
    7.                         End If
    8.                     End If

    reviewdate = 6/10/04
    biddate = 6/9/04

    Is it because I need to format them both to = mm/dd/yyyy so 6/9/04 would become 6/09/04, or is there a better way?

    Thanks in advance
    Last edited by demotivater; Jun 4th, 2004 at 02:26 PM.

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