• N is the column name in my Tally table (dbo.Tally). Do you have a Tally table? If so, what is the name of the column in your Tally table? You will need to replace the N in my query with that column name.

    If you don't have a Tally table, you need to create one.