How to set To Date is always greater than Start Date or can we gray out the To Date fields which are lesser than Start Date?

  • Experts – I have a requirement in my project where we have cascading parameters which are

    Here Area parameters is depending on To Date. When To Date is less than Start Date, it should throw an Warning / Popup says To Date should always greater than Start Date?

    Can someone please help me on how should I proceed further on the same?

  • Screenshot isn't visible. Kindly attach it.

  • I tried attaching but somehow it's not showing at Preview time as well.

    Can you help pls?

  • You can use the approach explained in this thread:

    http://social.msdn.microsoft.com/Forums/en-US/sqlreportingservices/thread/3db067f2-628e-432d-aa25-f63b1ccb1dfa/

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

  • Hi Koen,

    It works when I have only two parameters as Start Date and End Date. But in my case, I have other parameters as well which are cascading parameters. So this solution didn’t work in my case.

    Please help.

    Thanks,

    Srinivas

  • Hi Syed,

    Can you see my screenshot now?

    Thanks,

    Srinivas

  • Experts,

    Can someone please provide me an update on this please?

    Thanks,

    Srinivas

  • Srinivas MSBI (11/17/2011)


    Hi Syed,

    Can you see my screenshot now?

    Thanks,

    Srinivas

    No.

    When you post, bottom right hit edit attachements to upload. This button might be hidden. If it's the case hit the + and it should appear.

  • Please find the attached.

    Query: Whenever StartDate is greater than EndDate, it should throw a warning says "StartDate should not greater than EndDate". Here Area, Country, ProductName, Segment Name and Subsegment Name are cascading parameters.

    Please help me with the fix.

    Thanks,

    Srinivas

  • Srinivas MSBI (11/21/2011)


    Please find the attached.

    Query: Whenever StartDate is greater than EndDate, it should throw a warning says "StartDate should not greater than EndDate". Here Area, Country, ProductName, Segment Name and Subsegment Name are cascading parameters.

    Please help me with the fix.

    Thanks,

    Srinivas

    I don't bother with that, I just swap them for the end user with this =>

    ALTER PROCEDURE [dbo].[Validate_Begin_End_Dates] @BeginDate DATETIME OUT, @EndDate DATETIME OUT

    AS

    DECLARE @Swap DATETIME

    IF @BeginDate > @EndDate

    BEGIN

    SELECT @Swap = @BeginDate, @BeginDate = @EndDate, @EndDate = @Swap

    END

    GO

    COMMIT

  • Thanks a ton, much appreciated for your quick turnaround 🙂

  • Happy to help!

  • Thanks for your help, it worked but I need to throw a warning / pop up when user enters EndDate as lesser than StartDate than swapping the fields as given.

    Can you please help me with this scenario?

    Thanks!!

  • You can't do popups in ssrs.

    The best you can do is throw and error in the procedure (or maybe return nothing).

    And then do a conditional display of a big red textbox that says dates are in the wrong order.

  • Thanks for your reply, could you please elaborate with some steps please as you suggested?

Viewing 15 posts - 1 through 15 (of 22 total)

You must be logged in to reply to this topic. Login to reply