cancel
Showing results for 
Search instead for 
Did you mean: 

Procedure Paremeters (Datetime) changes to NULL in compiles version 7

Former Member
0 Kudos

Hi,

I have created a report based on a SQL 2005 procedure with start end date parameters.

When I run the report in the designer mode and refresh data the dates are correctly passed to the procedure and report produced.

I then compile the report to a .exe file and run report.

When I run te .exe and refresh data with new start and end date no data is retreived.

I checked with SQL Profiller and found that the .exe was not passing the dates to the procedure, both dates change to NULL.

Procedure NULL,NULL

I have used Crystal reports 2008 and not had this issue but in this older version the problem presents.

Can anyone help to resolve the issue or point me in the right direction.

-


Extract from procedure

ALTER Procedure [dbo].[Revenue] (@StartDate Datetime, @EndDate DateTime)

as

Declare @Start DateTime

Declare @End DateTime

set @Start = (select dateadd(day, datediff(day, 0, @StartDate), 0))

set @End = ( select dateadd(day, datediff(day, 0, @EndDate), 0))

select

count(*) as 'Line_count',

c_service_call.sa_person_id,

invoice_head.created_at as 'InvDate' ,

...........................etc

Kind Regards,

Eric

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Change to view and will upgrade to 2008

former_member292966
Active Contributor
0 Kudos

Hi Eric,

Wow, version 7 is over 12 years old so I doubt you'll get a working answer. Most people will tell you to upgrade but I'm guessing compiled reports are what you need and if I'm right, version 7 was the last version to have that.

I believe there were 3 updates to version 7 and they may still be available from the support download page. Something in the fuzzy memories of the late 90s is telling me there was a problem with dates at runtime. I know there were changes to how Crystal dealt with date parameters. New APIs were included to properly deal with them.

I'd have to recommend seeing if the updates are there or see about moving away from using Compiled Reports.

Good luck,

Brian

Former Member
0 Kudos

Brian,

Eventually got back to this issue and resigned report using a view. Will try to get customer onto 2008 version.

thanks again

Eric