Hi IssKint, thanks for getting back to me so quickly. Sounds like a good solution, my only question is how and where do I embed / save the function ready to call it with the query? Sorry if this is pretty basic, my knowledge up to this point is writing SQL queries / sub-queries. Fairly new to...