i had the same problem... in the end i just resorted to a UDF that is quite handy.
[url]http://www.cflib.org/udf.cfm?ID=744[/url]