I'm trying to display a recordset pulled from SQL Server using classic asp. I can display the regular data fine, however there is one field which is DateTime datatype in the database.
How do I Response.Write
the date?
I've tried this
<%=objRS(FormatDateTime("startdate",vbshorttime))%>
But it throws the error:
Description: Type mismatch: 'FormatDateTime'
What am I missing?
objRS("startdate")
if you want to useFormatDateTime()
you can do something like<%= FormatDateTime(objRS("startdate"), vbShortTime) %>
.Date
. TryCDate(objRS("startdate"))
to see if it is a value that can be converted to a date.