Speaking of bronze-age development, this is one of the very few threads I can post to. Attempting to reply to other threads (which look kinda "flat") raises an error. In true end-user fashion I've forgotten what the error message says...
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden