Forum Moderators: open
<title>Save Data</title>
<link rel="stylesheet" type="text/css" href="format.css">
</head>
<%
Number= Request.Querystring("Number")
RC_Number= Request.Querystring("RC_Number")
date_Begin = Request.Querystring("day") & "." & Request.Querystring("month") & "." & Request.Querystring("year") & chr(32) & Request.Querystring("hour") & ":" & Request.Querystring("minute") & ":00"
date_Begin=CDate(date_Beginn)
date_End = Request.Querystring("day") & "." & Request.Querystring("month") & "." & Request.Querystring("year") & chr(32) & Request.Querystring("hour") & ":" & Request.Querystring("minute") & ":00"
date_End=CDate(date_End)
RC_Description= Request.Querystring("RC_Description")
Description = Request.Querystring("Description")
Description_plausibel= Request.Querystring("Description_plausibel")
The Date Format I would like to use is this way: 24.10.2005 24:10:00. The User can select Day, Month, Year, Hour and Minute through Dropdowns(Comboboxes).
Does anybody have an idea, what should I do in this case? I will appreciate every Help.
Hätte jemand eine Idee was ich machen soll, um den Fehler zu beheben?
date_Begin=CDate(date_Beginn)
Another cause of this may be that your server side parse thinks it's using a different language and therefore doesn't know what CDate is. For example, if your server is setup to use JScript defaultly, it's not going to know how to evaluate this VBScript. To fix this for this page, you can add this to the top of your page:
<%@LANGUAGE=VBSCRIPT %>
-=casey=-
Error Type:
Microsoft VBScript runtime (0x800A000D)
Type mismatch: 'CDate'
Because I must translate my variables from german in english I forgot to delete the "n" at the end of Beginn, that wasn't the error.
I think what may be happening is that the date string (date_Begin) is not valid. You could also visually confirm this by Response.Write(date_Begin) to the screen so you can see what the value is.
sampleCode:
If Not IsDate(date_Begin) Then
Response.Write("date_Begin is invalid: " & date_Begin)
Else
' continue with code...
I would use the same code for date_End as well. Better to be safe, then sorry.
-=casey=-