Results 1 to 7 of 7
  1. #1
    Join Date
    Feb 2004
    Location
    Alpine Califormia
    Posts
    1,789

    Unanswered: 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)

  2. #2
    Join Date
    Nov 2004
    Location
    on the wrong server
    Posts
    8,835
    Provided Answers: 6
    when you give a parameter the option of being null, it is optional. so if you are not searching by date you do not have to pass that parameter.

    i do not develop reports, but I bet RS passes parameters wether you give them an argument or not. if there is no way around this in RS, this proc will not work for you and I am not sure if what you are trying to do can be done in RS.
    “If one brings so much courage to this world the world has to kill them or break them, so of course it kills them. The world breaks every one and afterward many are strong at the broken places. But those that will not break it kills. It kills the very good and the very gentle and the very brave impartially. If you are none of these you can be sure it will kill you too but there will be no special hurry.” Earnest Hemingway, A Farewell To Arms.

  3. #3
    Join Date
    Feb 2004
    Location
    Alpine Califormia
    Posts
    1,789

    Thank you for answering

    I have another stored procedure that ask for an Start date and an End date and it executes just fine in RS, I was wondering if I'm asking for too many parameters or something, I dont know. I'm just tryign to give the users more then one choice. When the Define Query Paramters come up it gives 4 paramter names maybe thats to much??

  4. #4
    Join Date
    Nov 2004
    Location
    on the wrong server
    Posts
    8,835
    Provided Answers: 6
    i think it does not like the fact that you leave some blank but I am not sure. you can not convert an empty string to a date, right?
    “If one brings so much courage to this world the world has to kill them or break them, so of course it kills them. The world breaks every one and afterward many are strong at the broken places. But those that will not break it kills. It kills the very good and the very gentle and the very brave impartially. If you are none of these you can be sure it will kill you too but there will be no special hurry.” Earnest Hemingway, A Farewell To Arms.

  5. #5
    Join Date
    Feb 2004
    Location
    Alpine Califormia
    Posts
    1,789

    I think so

    Looks that way, I guess
    so I have to enter in a value in all of them. I tried that and apparently thats the problem, but I was wanting the user to use one or the other not all the above. hmmm I see your point
    Last edited by desireemm; 12-13-07 at 14:13.

  6. #6
    Join Date
    Nov 2004
    Location
    on the wrong server
    Posts
    8,835
    Provided Answers: 6
    i think you need a RS expert. I do not have one handy at the moment, but it would seem to me that there should be someway to set up OR conditions in the screen where you enter your parameters.
    “If one brings so much courage to this world the world has to kill them or break them, so of course it kills them. The world breaks every one and afterward many are strong at the broken places. But those that will not break it kills. It kills the very good and the very gentle and the very brave impartially. If you are none of these you can be sure it will kill you too but there will be no special hurry.” Earnest Hemingway, A Farewell To Arms.

  7. #7
    Join Date
    Feb 2004
    Location
    Alpine Califormia
    Posts
    1,789

    Unhappy ok

    thanks anyways Thrasy, I appreciate

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •