Please help with a query to get the previous sales and current sales from each customer from the given query, my query is not working.
With Thanks
Pol
select * from (Select sum(qty) as pr_qty,sum(salestotal) as pr_amt, customer from sales where catagory = 'Premium' and salesdate >= #01-01-2013# and salesdate < #12-31-2013# group by customer) previousyrs, ( Select sum(qty),sum(salestotal) from sales where catagory = 'Premium' and customer = previous.customer and invdate >= #01-01-2014# );
polachan