This topic is locked
[SOLVED]

 time format

11/26/2013 6:35:56 AM
ASPRunnerPro General questions
K
kleanthis author

I want to show a time field without the seconds.
I try in the 'View as' custom:

strValue = FormatDateTime(strValue,4)

but is not working.
I get the error.

Microsoft VBScript runtime error '800a000d'
Type mismatch: 'FormatDateTime'
/include/aspfunctions.asp, line 2521
My field type is nvarchar(50). What I need to change?
Thank you.

mperry622 11/26/2013

Have you tried just the view as setting set to Date/Time?
Try this field first to see if that produces an error. also check the green check mark in the code section to test your syntax..

mperry622 11/26/2013

Here is some things i have found:
http://www.w3schools.com/vbscript/func_formatdatetime.asp
Example for 'View as' custom:

strValue = FormatDateTime(strValue,1)
More complicated example:

d=CDate(strValue)

strValue = Day(d) & " " & MonthName(Month(d)) & " " & Year(d)

K
kleanthis author 11/26/2013

Posted Today, 08:02 PM
Sorry guys...
The problem was in my data entry.
The code was correct.
strValue = FormatDateTime(strValue,4)
Thanx for your replies.

K
kleanthis author 11/26/2013

Sorry guys...
The problem was in my data entry.
The code was correct.
strValue = FormatDateTime(strValue,4)
Thanx for your replies.