I want rows for all dates in range. So I am using a table to insert the dates in range, thenjoining it to my table like:DECLARE @dates table (sdate datetime)INSERT @dates (sdate)SELECT dateadd(day, number, @Loc_START_DATE)FROM master..spt_valuesWHERE type = 'P'AND number < datediff(day, @Loc_START_DATE, @Loc_END_DATE + 1)...SELECT...FROM @dates d LEFT OUTER JOIN SAMPLE_DATA SMPD ON d.sdate = SAMPLE_START_DATE
since I am using LEFT join, shouldn't it give me all the rows? But its returning only rows with matching dates in the other table.Any ideas? Thanks.