Hi again Denis, thanks for sending me to this thread.
I think this thread was the one which triggered me to contact you.
The thing is, I know a little about T-SQl, but not that much. So, I've got this stored procedure, someone else made and I tried to modify it.
I originally did this (sorry...