• I am not sure if you are looking to do the same case in the where clause to compare the product and order load date with the start and end date

    where loaddate between @Start and @END

    the above where can be written as

    loaddate >= @Start and loaddate<= @END

    the below query migt be help for you , but if u could provide exact requrment with the sample data and the table structure , could help in writing

    where @END>loaddate and @Start<loaddate

    where @End >=

    CASE WHEN a.loadate >= b.loaddate

    THEN a.loaddate

    ELSE b.loaddate

    END

    and

    @Start <=

    CASE WHEN a.loadate >= b.loaddate

    THEN a.loaddate

    ELSE b.loaddate

    END