Eric,
My first inclination would be that the query you use to populate the cursor is not getting the correct data. If you just run the SELECT query in the 'Declare Cursor' portion of the code, are you getting the correct data?
If not, this code needs to be amended.
If so, can you provide some sample data and the code?
Thank you,
The MSSQLTips Team