DECLARE @MyVar datetime = '1/1/2010'
Returns : '1/1/2010'.
I want to create a calendar with dates like:
Then I want to FOR EACH through the numbers and run the SQL Query.
Something like (pseudocode):
List = 1/1/2010,2/1/2010,3/1/2010,4/1/2010,5/1/2010
For each x in List
DECLARE @MyVar datetime = x
So this would return:-
1/1/2010 2/1/2010 3/1/2010 4/1/2010 5/1/2010
I may need to add some sort of union at the conclusion of the query so that each iteration of the loop unions onto the next because I want this to provide the data as a single resultset rather than numerous resultsets.