Query Problem
Good morning,
I wonder if someone could help, I have two queries based on date ranges, I would like to see them side by side but cant work out how to.
select customer, sum(nett)Nett,sum(items)Items,Sum(area)M2
from goorders
where ordered BETWEEN GETDATE()-7 AND GETDATE()
group by customer
order by Nett DESC
select customer, sum(nett)Nett,sum(items)Items,Sum(area)M2
from goorders
where ordered BETWEEN GETDATE()-15 AND GETDATE()-8
group by customer
order by Nett DESC
I would like to see as :-
Customer Nett (This Week) Nett (Last Week) Items (This Week)Items (Last Week)M2 ()This Week)M2 (Lats Week)
Can anyone better than me help please,, i would be vert grateful.
JD
Good morning, I wonder if someone could help, I have two queries based on date ranges, I would like to see them side by side but cant work out how to. select customer, sum(nett)Nett,sum(items)Items,Sum(area)M2from goorderswhere ordered BETWEEN GETDATE()-7 AND GETDATE()group by customerorder by Nett DESC select customer, sum(nett)Nett,sum(items)Items,Sum(area)M2from goorderswhere ordered BETWEEN GETDATE()-15 AND GETDATE()-8group by customerorder by Nett DESC I would like to see as :- Customer Nett (This Week) Nett (Last Week) Items (This Week)Items (Last Week)M2 ()This Week)M2 (Lats Week) Can anyone better than me help please,, i would be vert grateful. JD Read More