locked
Parameter mapping issue no records are returned in sql RRS feed

  • Question

  • Hi All, In my SQL for a report dataset

    I have a datetime variable declared:

    Declare @YTD datetime

    select @YTD=getdate()

    and Ive mapped the @YTD like this 

    Select my columns from mytable where DealDate between  '01/01/2020' and @YTD

    My reports bring back no records  in SSRS where as SSMS brings results, Do i need to Map @YTD? to report parameter I thought since I already have it in my where clause i dont need to. I am very new to SSRS and I cant seem to move forward..

    Friday, August 7, 2020 7:32 PM

All replies

  • Hi

    You can pass the parameter like this . Follow the bellow link for more details

    https://www.c-sharpcorner.com/UploadFile/7d3362/ssrs-report-for-parameterize-stored-procedure/

    Thanks and regards

    Saturday, August 8, 2020 6:08 PM
  • Hi,

    Hope that I understand your meaning correctly.

    Do you mean that when you create a dataset with "Select my columns from mytable where DealDate between  '01/01/2020' and @YTD", bring back no records in report designer?

    I have tested locally, I could return the data in Visual Studio.

    If I misunderstand, please incorrect me.

    Regards,

    Zoe


    ""SQL Server related"" forum will be migrated to a new home on Microsoft Q&A SQL Server!
    We invite you to post new questions in the "SQL Server related" forum’s new home on Microsoft Q&A SQL Server !
    For more information, please refer to the sticky post.

    • Proposed as answer by Zoehui-MSFT Friday, August 14, 2020 1:24 AM
    Monday, August 10, 2020 7:14 AM
  • Hi,

    I’m following up in case you have further questions regarding the issue.

    If yes, please feel free to let me know. Else, please remember to mark as answer.

    Regards,

    Zoe


    ""SQL Server related"" forum will be migrated to a new home on Microsoft Q&A SQL Server!
    We invite you to post new questions in the "SQL Server related" forum’s new home on Microsoft Q&A SQL Server !
    For more information, please refer to the sticky post.

    Thursday, August 13, 2020 2:06 AM