G
Guest
I need to store the date as a string of 8 numbers but still test if I have a
valid date. I tested by formatting my string as a date (mm/dd/yyyy) and then
applied IsDate function. However, if I invalidate the "date" by removing a
character from the year, IsDate still resolves as TRUE. So, I tried the
following test and still couldn't make my test work. I don't know what I am
doing wrong. Can anyone help?
My test code:
Dim strDate As String
strDate = "01/01/200" 'I removed a digit from the year to invalidate the
date.
MsgBox strDate & " is " & IsDate(strDate)
Message says: 01/01/200 is True
Shouldn't it say False?
valid date. I tested by formatting my string as a date (mm/dd/yyyy) and then
applied IsDate function. However, if I invalidate the "date" by removing a
character from the year, IsDate still resolves as TRUE. So, I tried the
following test and still couldn't make my test work. I don't know what I am
doing wrong. Can anyone help?
My test code:
Dim strDate As String
strDate = "01/01/200" 'I removed a digit from the year to invalidate the
date.
MsgBox strDate & " is " & IsDate(strDate)
Message says: 01/01/200 is True
Shouldn't it say False?