• Apologies that I keep posting but I have just amended part of the ISNULL section to DATEADD(DD,DATEDIFF(DD,0,GETDATE()),3650))

    and this now allows me to extend the working pattern forwards, as I am still not fully understanding all of the

    code would someone be able to confirm that this is correct?