Hi,
It does not really help because I have no way to run it and see the problem. Meanwhile, my only guess is that something is going wrong with your REPLACE() function. You should be able to remove a character by using the REPLACE() function correctly.
.