Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing a time value to parameter

Status
Not open for further replies.

D1000

Technical User
Aug 16, 2002
46
0
0
US
I have a simple Crystal report (v9) that takes a single parameter of type time. We are calling the report using the RDC component, but we get a Type Mismatch error when using the following code:

Call parameterFieldsCollection(1).AddCurrentValue(CTime("11:00:00"))

-- also used the following variations with the same result:
Call parameterFieldsCollection(1).AddCurrentValue(CTime("11:00:00 AM"))

Call parameterFieldsCollection(1).AddCurrentValue(CTime("11:00:00AM"))

Call parameterFieldsCollection(1).AddCurrentValue(CString("11:00:00"))

Other data types work fine. Am I doing something wrong here?
 
The correct call is:

Call parameterFieldsCollection(1).AddCurrentValue(CDate("11:00:00 AM"))

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top