• I pretty much don't even know how to spell "SSRS". With that though in mind, here's how I'd do it in T-SQL. I would imagine that it wouldn't be much more difficult to do in SSRS.

    --===== Here are the two parameters + a working variable.

    DECLARE @StartDate DATETIME

    ,@EndDate DATETIME

    ,@Swap DATETIME

    ;

    --===== This simulates passing the parameters

    SELECT @StartDate = GETDATE()

    ,@EndDate = GETDATE() +10 --<<Change this number to test

    ;

    --===== This will put the parameters in the correct order

    -- if they're out of order. This is the code I'm talking about.

    SELECT @Swap = @StartDate

    ,@StartDate = @EndDate

    ,@EndDate = @Swap

    WHERE @StartDate > @EndDate

    ;

    --===== This just verifies the result.

    SELECT @StartDate, @EndDate

    ;

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)