I have a table that shows sales for the year and I need to return from it sum of sales for each day...
Currently the table shows each sale made therefore yesterday we had 20 orders so the select query returns 20 lines when I run the following query:-
select date,sum (case when (left(element2,2))=('00') then (amount) end) as sales
group by date,element2
having date >='01-nov-2010'
order by date
I am trying to return a total sales value for each day...the above query does not work- any ideas what I am doing wrong?
Thanks for the help!