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

Stored Procedure Question

Status
Not open for further replies.

sburden

Programmer
Dec 4, 2002
35
US
Hello:

I received the error message below when attempting to run my stored procedure(located at bottom) and I don't know why. When I execute the stored procedure on SQL Server it runs fine however, that not the case when I run it is RS 2005.

Additionally, my two date parameters are defined as DateTime in RS. I keyed in the date and I tried 3 different formats('04/01/07', '04/01/2007', '04-01-2007').


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)

------------------------------
BUTTONS:

OK
------------------------------







Code:
BEGIN


SELECT 

DirID, 

[State],

DirName,

PubCode,

CloseDate, 

PubDate,

Pub_Initials,

DirVer


FROM v_CurrentDirsDetail

WHERE (DirID = @DirNum) AND @FromCloseDate IS NULL AND @ToCloseDate IS NULL OR

(@DirNum IS NULL) AND CloseDate BETWEEN @FromCloseDate AND @ToCloseDate


END


 
I resolved my issue. For Report Parameters, I had to select "Allow null value" and select "Null" for defalult values. Then I run the individual dataset and the "Define Query Parameters" dialog box appears. I select the <null> parameter value for the column it applies to and key in the values for the other column(s).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top