• I have tried variations with IsNull to no avail. I haven't tried with a CTE first as I am not that familiar with it but I will check it out.

    Thanks for the reply.