by Adeel Ehsan (1 Submission)
Category: Databases/Data Access/DAO/ADO
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Fri 30th April 2004
Date Added: Mon 8th February 2021
Rating: (1 Votes)
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
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
No comments have been posted about This code checks the given date for the format dd/mm/yyyy according to the SQL Server limitation.. Why not be the first to post a comment about This code checks the given date for the format dd/mm/yyyy according to the SQL Server limitation..