I am having a serious problem trying to compare dates. I am trying to compare a specific month like someone's birthmonth to another specific month like one that has been stored as an Issue date. An example of the problem is that I have a person with a birth month of February (2) and an Issue date with the month of October (10), well...I always thought that 2 was less than 10, but according to my code in VB6 it is not. Here's an example of my code please help!!!!
Dim theBirthMonth as String
Dim theIssueMonth as String
theBirthMonth = Month(dtDOB)
theIssueMonth = Month(dtIssue)
If theBirthMonth <= theIssueDate then
"I'll do this"
Else
"I'll do something different"
End IF
Please explain why if theBirthMonth is 2 it is not less than theIssueMonth of 10, works fine if birth month is 10, 11 or 12.
Dim theBirthMonth as String
Dim theIssueMonth as String
theBirthMonth = Month(dtDOB)
theIssueMonth = Month(dtIssue)
If theBirthMonth <= theIssueDate then
"I'll do this"
Else
"I'll do something different"
End IF
Please explain why if theBirthMonth is 2 it is not less than theIssueMonth of 10, works fine if birth month is 10, 11 or 12.