View Single Post
Old 09-20-2012, 11:27 PM   PM User | #11
Old Pedant
Supreme Master coder!

 
Old Pedant's Avatar
 
Join Date: Feb 2009
Posts: 23,172
Thanks: 59
Thanked 3,994 Times in 3,963 Posts
Old Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to all
Well, it *SHOULD* work if all your values in that column match what you showed in that screen shot.

Example code:
Code:
<%
Response.Write CDATE("2012-05-30") & "<hr/>"
Response.Write CDATE("2011-02-10") & "<hr/>"
Response.Write CDATE("2009-09-10") & "<hr/>"
%>
But if any of your values there are not legal dates in the form YYYY-MM-DD then of course you could get that error.

So maybe do this:
Code:
<%
On Error Resume Next
    cncrtDate = objRS4("Cncrt_Dateseq")
    dt = DATEVALUE( CDATE( cncrtDate ) )
    If Err.Number > 0 Then 
        Response.Write "INVALID DATE:"
        dt = DATE()
    End If
On Error GoTo 0
If  dt = DATE() Then
    Response.Write "<h1>" & cncrtDate & "</h1>"
Else
    Response.Write "<h3>" & cncrtDate & "</h3>"
End If
%>
Now you will get the INVALID DATE message and it will show you which of the values from your DB has got a problem.
__________________
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.
Old Pedant is offline   Reply With Quote