G
Guest
Somebody please help me here. Why does this function NOT work? IsDate
returns false, even though it is a valid date.
Function main()
Dim a, b, c, sDate
sDate = "20011130"
a = Left(sDate, 4)
b = Mid(sDate, 5, 2)
c = Right(sDate, 2)
If IsDate(a & b & c) Then
main = DateSerial(a, b, c)
Else
main = DateSerial(2111, 1, 1)
End If
End Function
Thanks.
returns false, even though it is a valid date.
Function main()
Dim a, b, c, sDate
sDate = "20011130"
a = Left(sDate, 4)
b = Mid(sDate, 5, 2)
c = Right(sDate, 2)
If IsDate(a & b & c) Then
main = DateSerial(a, b, c)
Else
main = DateSerial(2111, 1, 1)
End If
End Function
Thanks.