Wrox Programmer Forums
Go Back   Wrox Programmer Forums > SQL Server > Reporting Services
|
Reporting Services SQL Server Reporting Services. Please specify which version.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Reporting Services section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 13th, 2007, 11:23 PM
Authorized User
 
Join Date: Aug 2004
Posts: 38
Thanks: 0
Thanked 0 Times in 0 Posts
Default Report Services Wont execute My SP

Everytime I try to execute my SP in Report Services this is the message I get
I can execute it in SQL Server and have no problems at all it gives me exactly what I ask for. Help please

TITLE: Microsoft Report Designer
------------------------------

An error occurred while executing the query.
Failed to convert parameter value from a String to a DateTime.

------------------------------
ADDITIONAL INFORMATION:

Failed to convert parameter value from a String to a DateTime. (System.Data)

------------------------------

String was not recognized as a valid DateTime. (mscorlib)


Code:
ALTER PROCEDURE [dbo].[SearchByDateLstNmDuration]
@StartDateserved datetime = null,
@EndDateserved datetime = null,
@Enter_LastName nvarchar(25) = null, 
@Enter_Duration nvarchar(10)  = null
AS 
SELECT      IR#, [Date served], [Reason for Exclusion], Duration, [First Name], [Last Name]
FROM          [dbo].[Extended Exclusions]
WHERE  (@StartDateserved is null or [Date served] >= @StartDateserved) 
AND (@EndDateserved is null or [Date served] <= @EndDateserved)
AND (@Enter_LastName is null or [Last Name] = @Enter_LastName) 
AND (@Enter_Duration is null or Duration = @Enter_Duration)
 
Old December 21st, 2007, 03:46 AM
Authorized User
 
Join Date: Jul 2003
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Is the date parameter from your report template being passed to the stored procedure as a string?

Can alter your stored procedure to something similar to this:

ALTER PROCEDURE [dbo].[SearchByDateLstNmDuration]
@StartDateserved varchar(12),
@EndDateserved varchar(12),
...
...
WHERE (@StartDateserved is null or [Date served] >= convert(datetime,@StartDateserved,103))
...
...






Similar Threads
Thread Thread Starter Forum Replies Last Post
Using SP in Crystal Report with c# psutradhar C# 0 January 12th, 2007 06:27 AM
Execute DTS with input parameters from a SP dbradley SQL Server 2000 6 March 22nd, 2006 05:36 AM
Execute a Report bmains SQL Server DTS 0 May 31st, 2005 08:27 AM
SP to report all databases with Last backup Hal Levy SQL Server 2000 4 May 17th, 2005 10:32 AM
Report wont display from Report Manager. dillig BOOK: Professional SQL Server Reporting Services ISBN: 0-7645-6878-7 0 July 14th, 2004 11:25 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.