In reply to C Paxton.

I ran my test in 9.4m3 and got the wrong results with your function. But running it in 9.3, the results from your function were correct. I'll need to apply latest 9.4m3 hotfixes to see if there is a difference before pursuing it with R&D.