ReportingAnalyst
MIS
When I look into the source of my dropdown box, my date looks like this: 4/30/2006
Above is pulled from SQL Server 2005.
Now in my ASP page, I wrote this:
'This line creates an object to reference the 2nd parameter in the report.
'Period is datetime. Hence cast as double of type number 10. (See the chart below)
Set MyParam2 = Session("Param").Item(2)
splitdate = split(Request.form("Period"), "/")
MynewDate1 = splitdate(2) & "/" & splitdate(0) & "/" & splitdate(1) & " 12:00:00 AM"
MyParam2.SetCurrentValue CDate(MynewDate1)
When I run this, my IE browser mentions this error:
Error Type:
Microsoft VBScript runtime (0x800A000D)
Type mismatch
/scripts/ViewReports.asp, line 112
Where line 112 refers to:
MyParam2.SetCurrentValue CDate(MynewDate1)
I even tried this:
MyParam2.SetCurrentValue(CDate(MynewDate1,10))
I get the following error.
Error Type:
Microsoft VBScript runtime (0x800A01C2)
Wrong number of arguments or invalid property assignment: 'CDate'
/scripts/ViewReports.asp, line 113
So what error am I making?
Thanks.
Above is pulled from SQL Server 2005.
Now in my ASP page, I wrote this:
'This line creates an object to reference the 2nd parameter in the report.
'Period is datetime. Hence cast as double of type number 10. (See the chart below)
Set MyParam2 = Session("Param").Item(2)
splitdate = split(Request.form("Period"), "/")
MynewDate1 = splitdate(2) & "/" & splitdate(0) & "/" & splitdate(1) & " 12:00:00 AM"
MyParam2.SetCurrentValue CDate(MynewDate1)
When I run this, my IE browser mentions this error:
Error Type:
Microsoft VBScript runtime (0x800A000D)
Type mismatch
/scripts/ViewReports.asp, line 112
Where line 112 refers to:
MyParam2.SetCurrentValue CDate(MynewDate1)
I even tried this:
MyParam2.SetCurrentValue(CDate(MynewDate1,10))
I get the following error.
Error Type:
Microsoft VBScript runtime (0x800A01C2)
Wrong number of arguments or invalid property assignment: 'CDate'
/scripts/ViewReports.asp, line 113
So what error am I making?
Thanks.