2 things..

(1) I would remove the last line: return..

(2) If you are going to use a UDF, I would include the "Header" Information.. What would happen if you left the company? Plus, you should give credit where credit is due: Neither you nor me wrote this UDF.

I would recommend reading the following topic.
Best Practices and Methods

Also, there are a number of great topics at: KiXtart FAQ & How to's

Thanks,

Kent
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's