I searched before posting and followed instructions but it still did not work for me. I need to compare 2 dates but regardless of what the dates are they always return the same value on comparison. Here is my code:
-
Dim EndDate As DateTime
-
Dim Current As DateTime = Today
-
-
If DateTime.Compare(Current, EndDate) < 0 Then
-
Label6.Text = "CONTRACT EXPIRED LESS THAN"
-
End If
-
If DateTime.Compare(Current, EndDate) = 0 Then
-
Label6.Text = "CONTRACT EXPIRED EQUALS"
-
End If
-
If DateTime.Compare(Current, EndDate) > 0 Then
-
Label6.Text = "CONTRACT NOT EXPIRED GREATER"
-
End If
The EndDate is being pulled in from a database and no matter what the end date is whether is be greater or less than todays day is always displays as CONTRACT NOT EXPIRED GREATER. Anyone have an idea of what I am doing wrong? Thanks very much in advance!