I have a msaccess report that fires off a stored procedure as the code below shows
what i have is that the procedure fires asks for a start date and end date, then these values are used to build another table that I use for my report. But I require these dates to display on the report so I need to return the vaues for example return @startdate + ' to ' + @finishdate or create a varable and build this string then return the string so that I can place it on the report. then how do I access the value to place it on the top of the report that was used to find the data..
But every time I try it keeps compaining about the fact that it cannot return an int value. the code below is were I have left it, have tried various string configurations but to no avail declare string return string ect
should be easy for a sql guru
thanks for you help in advance
**************************
**********
**********
**********
*
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[AppendToAcademicPro
gressRptBo
th]
@StartDate smalldatetime,
@FinishDate smalldatetime
AS
SET NOCOUNT ON;
BEGIN
Declare @return_value varchar(20)
DELETE from AcademicProgressRptBoth
where ID > 0
INSERT INTO AcademicProgressRptBoth ( StudCourseID, Status, ModuleID )
SELECT dbo.StudentCourse.StudCour
seID AS Expr2, dbo.StudentModules.Status,
dbo.StudentModules.ModuleI
D
FROM dbo.StudentModules INNER JOIN
dbo.StudentCourse ON dbo.StudentModules.StudCou
rseID = dbo.StudentCourse.StudCour
seID
WHERE
dbo.StudentModules.DateCom
plete >= @StartDate and dbo.StudentModules.DateCom
plete <= @FinishDate
return @startdate + ' to ' + @finishdate
END
Start Free Trial