• Cheers Ed, that's great. I guess it works better due to the function not exposing statistics to the query optimiser, but welcome you're take on what inspired you to change it.

    (Updating my scripts, thank you)

    r