Trying to modify this to always return 3 months regardless if something exists in the table or not.
My feable attempt was to create a table with September, October and November in a months table with column name monthsN. Then incorporate a left join...failing miserably.
The SQL is below...
Appreciate any assistance or guidance!!
select sum(distance) as miles, username, monthname(rundate) from log3
[COLOR="Red"]left join months on monthsN = monthname(rundate)[/COLOR]
where rundate between '2008-09-01' and '2008-11-30' and username = 'joe' group by monthname(rundate), username order by rundate