carlosparedes
Programmer
hi guys
I am trying to format the date, I get in input box, into ddmmyyyy (without separators).
I am getting the following error:
Microsoft VBScript runtime (0x800A000D)
Type mismatch: 'date1'
I don't Know what I am doing wrong.
<Code>
Select Date: <input type="date" name="date1" size="16" valign="top">
<%Function FormatDateNoSep(date1, yrDig)
Dim strYYYY
Dim strMM
Dim strDD
strYYYY = CStr(DatePart("yyyy",date1))
if yrDig = 2 then strYYYY = Right(strYYYY, 2)
strMM = CStr(DatePart("m", date1))
If Len(strMM) = 1 Then strMM = "0" & strMM
strDD = CStr(DatePart("d",date1))
If Len(strDD) = 1 Then strDD = "0" & strDD
FormatDateNoSep = strMM & strDD & strYYYY
End Function %>
<% = FormatDateNoSep(date1(),4) %>
</code>
Can you help me
Thanks in advance
Sandra
I am trying to format the date, I get in input box, into ddmmyyyy (without separators).
I am getting the following error:
Microsoft VBScript runtime (0x800A000D)
Type mismatch: 'date1'
I don't Know what I am doing wrong.
<Code>
Select Date: <input type="date" name="date1" size="16" valign="top">
<%Function FormatDateNoSep(date1, yrDig)
Dim strYYYY
Dim strMM
Dim strDD
strYYYY = CStr(DatePart("yyyy",date1))
if yrDig = 2 then strYYYY = Right(strYYYY, 2)
strMM = CStr(DatePart("m", date1))
If Len(strMM) = 1 Then strMM = "0" & strMM
strDD = CStr(DatePart("d",date1))
If Len(strDD) = 1 Then strDD = "0" & strDD
FormatDateNoSep = strMM & strDD & strYYYY
End Function %>
<% = FormatDateNoSep(date1(),4) %>
</code>
Can you help me
Thanks in advance
Sandra