hopefully someone can help with the following sql query. i'm using sql server 2000.
i'm looking to return monthly data for 2 years (say 2006/2007) so that it can be charted.
so far i can return a single year's data but i need to be able to retrieve data for both years in a single query.
the query looks like this so far :
select sum(job_effort) as sum2006, datename(month, job_close_date) as monthname from jobs
WHERE year(job_close_date) = 2006
group by datename(month, job_close_date), month(job_close_date)
order by month(job_close_date)
as you can see, i simply want to sum the job_effort by the job_close_date - a single column for 2006 data and another for 2007 data.
can someone point me in the right direction ?
thanks in advance