• Hi Mark,

    Sorry for my late reply.

    I tried your solution upon running the query if my condition for @@rowcount is < 0 dynamically the date did not process the less 1 day but when change to @@rowcount=0 it is working. the problem when compiling the SSRS

    it takes time and then goes hang with message "Query Designer: not responding". thanks.

    --dynamics date not working

    IF @@ROWCOUNT < 0

    BEGIN

    --got an error from this portion

    SET @PFromDateInside=@PFromDateInside -1

    SET @PToDateInside=@PToDateInside-1

    --working

    IF @@ROWCOUNT = 0

    BEGIN

    --got an error from this portion

    SET @PFromDateInside=@PFromDateInside -1

    SET @PToDateInside=@PToDateInside-1