Jump to content

T-SQL to get numbers between 1 and n?


stuartmarsh

Recommended Posts

I have some SQL that gets the current week number based on today's date I.e 200940.

Based on that I want to get the last n weeks, so ultimately I have a SQL that gives me

WeekNo
200940
200939
200938
200937

I could do this with a loop in PHP but I'm trying to do it in the SQL if possible.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.