I have to admit I've not used calculations etc. in table variables, there are a number of "issues" with table variables which may or may not be a bug .. I assume your code works with a temp table.
[font="Comic Sans MS"]The GrumpyOldDBA[/font]
www.grumpyolddba.co.uk
http://sqlblogcasts.com/blogs/grumpyolddba/