• This is the known issue that parametter can not be passed in any inner query or inside function call like DATEADD in your case.

    I have faced same problem when passing parametter in WHERE clause of inner query and derived table and it does not work at all. while it does perfectly in outer queries.

    hope this help.

    Note: I have already reported this bug to microsoft few days ago hope this will get fixed in SP2

    FurrukH baig