I have a report with the data source from a SQL Server 2000 stored procedure. When I execute this stored produre from Query Analyzer, I got more than 10000 records returned, but got no records back for the report from Crystal Report 8 and error message "Failed to open rowset" from Crystal Report.NET. Any help or ideas will be greatly appreciated. Thanks in advance.
Below is my stored procedure:
CREATE PROCEDURE spTest
@dtDateWanted as DateTime,
@strCurr as varchar(3)
AS
SET NOCOUNT ON
/* ger current date for later comparison */
declare @strCurrDate as DateTime
select @strCurrDate = GetDate()
select x0.linvoice, x0.lmatter as matter, x2.mcurrency as currency, x0.ltradat as billdate, x0.lindex as lindex, x0.lamount
from ledger x0, ledcode x1, matter x2, periodt x3
where x0.llcode = x1.lccode
and x0.lmatter = x2.mmatter
and x0.lperiod = x3.pe
and x1.lcdebcr = 'D'
and x0.laptoin is null
and x0.ltradat <= @dtDateWanted
and (year(x3.pebedt) < year(@dtDateWanted) or (year(x3.pebedt) = year(@dtDateWanted) and month(x3.pebedt) <= month(@dtDateWanted)))
and x0.lzero = 'N'
and x0.lamount <> 0
and x1.lcfco <> 'T'
and x2.mcurrency like (select case when @strCurr = '*' then '%' else @strCurr + '%' end)
GO
Below is my stored procedure:
CREATE PROCEDURE spTest
@dtDateWanted as DateTime,
@strCurr as varchar(3)
AS
SET NOCOUNT ON
/* ger current date for later comparison */
declare @strCurrDate as DateTime
select @strCurrDate = GetDate()
select x0.linvoice, x0.lmatter as matter, x2.mcurrency as currency, x0.ltradat as billdate, x0.lindex as lindex, x0.lamount
from ledger x0, ledcode x1, matter x2, periodt x3
where x0.llcode = x1.lccode
and x0.lmatter = x2.mmatter
and x0.lperiod = x3.pe
and x1.lcdebcr = 'D'
and x0.laptoin is null
and x0.ltradat <= @dtDateWanted
and (year(x3.pebedt) < year(@dtDateWanted) or (year(x3.pebedt) = year(@dtDateWanted) and month(x3.pebedt) <= month(@dtDateWanted)))
and x0.lzero = 'N'
and x0.lamount <> 0
and x1.lcfco <> 'T'
and x2.mcurrency like (select case when @strCurr = '*' then '%' else @strCurr + '%' end)
GO