I'm writing a program that's interacting with a database that has two tables. The table relevant to my question is my customer table, which has a Date/Time field that expresses the current customers account expiration date.
I'm having trouble comparing a customer's expiration date to another date object to verify if their account expired.
This code checks if a Dvd is checked out, if it isn't, ask the user's account number. Next I check (where error keeps occuring) if the expiration date is prior to todays date, thus making it valid, but it doesn't work that way. In which ways can you go about comparing two dates? Maybe I missed a certain method pertaining to comparing dates, I saw a compareTo, nothing like an isLessThen or similar. Any help would be greatly appreciated, thanks a lot. Also, when I copied my code over it automatically put returns so it's sort of hard to read, sorry for that.
If dbSetAdapter.Tables("Dvds").Rows(index).Item("CheckedOutBy") = "XXXXXXX" Or 0 Then
response = InputBox("Enter your account number", "Account Number")
If findAccount(response, 0) <> -1 Then
accountIndex = findAccount(response, 0) 'account found, put index in variable
If cusSet.Tables("Customer").Rows(accountIndex).Item("ExpirationDate") < Date.Today Then 'ERROR HERE, How to compare if one date is "less then" another
MessageBox.Show("not expired")
End If
Else
MessageBox.Show("Account number does not exist")
End If
Else
MessageBox.Show("This DVD is checked out.")
End If