Graph Sales By Quarter

Icehousman2

Registered User.
Local time
Yesterday, 18:33
Joined
May 12, 2004
Messages
45
I need to show a graph on a report, that displays the total number of houses sold during the last year, by quarter. We are using a calander year, so the first quarter would be Jan-March. The field in the table that has the date the house was sold is called DocDate. I'm having problems setting up a query that will sort this information the way I want it to. Mainly, setting up criteria, that uses month but not year. Any help would be greatly appreciated. Thanks in advance.
 
Icehousman2 said:
... Mainly, setting up criteria, that uses month but not year. ...

Not quite clear why you'd want not not to include year in your calculations. Unless this is one year only database, you'd end up with sales figures from 2003 & 2004.

Here's a quarterly example using Northwind's Orders table. When prompted, enter a year (1994 - 1996). The query will return total number of orders for each quarter in which there were sales. Should be able to adapt this to your scenario.
Code:
SELECT
    Year([OrderDate]) AS SalesYr
  , DatePart("q",[OrderDate]) AS SalesQtr
  , Count(Orders.OrderID) AS QuarterlySales
FROM
   Orders
GROUP BY
   Year([OrderDate])
  , DatePart("q",[OrderDate])
HAVING
   (((Year([OrderDate]))=[enter year]));
HTH - Bob
 
Thanks, for the help, i only had to modify it a little for it to work perfectly.
 

Users who are viewing this thread

Back
Top Bottom