Found also
Re: Can this be done in SQL? Thread #
1296067 Message #
1296082this time I searched by 'SQL UDF' and used Sergey as from. And expanded a time frame to 2007.
>Thank you Naomi, I'll try it.
>
>>>Are you using VFP or SQL Server? If the later, which version. It is a piece of cake in SQL Server 2005 and up. In VFP you need to use custom function.
If it's not broken, fix it until it is.
My Blog