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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CR XI: Passing a datetime parameter to Stored Procedure via rpt 1

Status
Not open for further replies.

maggiesda

Programmer
Jul 28, 2000
23
US
I'm using C# to present a report. I'm using some sample code, which I admittedly understand only slightly.
Here's the line where I try to pass the data:
parameterFieldDefinition.ApplyCurrentValues(currentParameterValues);

I can pass a datetime parameter for an rpt-only parameter, using this format: "1/15/2006" but that won't work if the parameter has to get passed to the rpt's stored procedure. I have tried a half dozen formats, all to no avail.

Here they are:
"Date(2007,12,30)"
"2007-12-30 00:00:00"
"Date(2007,12,30 00:00:00)"
"12/30/2006" (This works for the rpt parameter.)
"CDate(12/30/2006 12:01:00)"

Thanks in advance.
 
What version are you working with, which database????

Thanks so much!
satinsilhouette
 
I'm using CR XI with SQL Server (2000). We are moving from CR 8.5 to XI, which is a huge leap because the API we used with 8.5 has gone away. In 8.5, we were able to pass the date in this format: Date(2006,12,30). But that doesn't work with CR XI.

Thanks.
 
I don't know if this will help you any, but we are working with Delphi, CR9 and CRXI and Interbase.

We have found some cases were we can pass a date from Delphi to CR9 to a stored procedure in Interbase, but have also found cases were using date format does not work (haven't figured out why it fails sometimes). In those cases, we have found that we must pass the date as it's components. That is, we use three text fields for day, month, year and then in the stored procedure we turn these back into the date.

If you can't get the date to work in your environment, you may want to try breaking it up in that manner.
 
Many thanks for that tip. We shifted to a C# solution but I anticipate having the same issue with passing dates. I will keep your workaround in mind and start looking on the Business Objects knowledge base for bug reports related to this. If I find any, I'll post them here.

Good luck on your project.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top