This code checks the given date for the format dd/mm/yyyy according to the SQL Server limitation.
This code checks the given date for the format "dd/mm/yyyy" according to the SQL Server limitation. You can use it to make the date check very
Rate This code checks the given date for the format dd/mm/yyyy according to the SQL Server limitation.
(1(1 Vote))
Dim v As Integer
If InStr(dateVal, " ") <> 0 Then
checkDate = False
ElseIf val(Left$(dateVal, 2)) > 31 Then
checkDate = False
ElseIf val(Mid$(dateVal, 4, 2)) > 12 Then
checkDate = False
ElseIf val(Mid$(dateVal, 7, 4)) < 1753 Or val(Mid$(dateVal, 7, 4)) > 9999 Then
checkDate = False
ElseIf Not IsDate(dateVal) Then
checkDate = False
Else
checkDate = True
End If
End Function
This code checks the given date for the format dd/mm/yyyy according to the SQL Server limitation. Comments
No comments yet — be the first to post one!
Post a Comment