Roy Harvey
3/21/2007 12:59:00 PM
Try this and see if it gives you something to work with.
SELECT Sum(Sales) As Sales, SalesDate
FROM Sales
GROUP BY SalesDate
Roy Harvey
Beacon Falls, CT
On Wed, 21 Mar 2007 12:39:34 GMT, "Manny123" <u30518@uwe> wrote:
>Hi there,
>
>I would like to know how to accomplish the following;
>
>The Outer query is retrieving Sales numbers from a date range and the Inner
>Query should retrieve numbers from each date from the outer query od last
>year.
>
>@StartDate datetime,
>@EndDate datetime
>
>SELECT Sum(Sales) As Sales, SalesDate
>FROM Sales
>
> (SELECT Sum(Sales) AS SalesLY ??????
>
>WHERE SalesDate Between @StartDate AND @EndDate
>
>I was able to accomplish this but only for a single date but I can't find a
>way to modify it to take a date range.
>
>Thanks for your help.
>
>Manny