• Where exactly you are using this function , well to me it doesnt look like that this function itself might create some problem.as it doesnt have any kind of comple logc or calculation.What is the second query all about ? or i am overlooking something.

    -------Bhuvnesh----------
    I work only to learn Sql Server...though my company pays me for getting their stuff done;-)