473,324 Members | 2,370 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

Show Month over Month Declining Sales

I am trying to construct a query that sums sales by salespersons and
only returns a list of salespersons that have a sum of sales lower than
the previous month for whatever date rane is selected.
For example, if the user selects a date range of Sept.1 ,2004 thru Dec.
31, 2004 the query will return only salespersons where October was
worse than September and November was worse than october and December
was worse than November...

Is ths possible?

The basic query is:

SELECT Contacts.UniqueID, Contacts.LastName, Sum(Sales.Amount) AS
SumOfAmount
FROM Contacts LEFT JOIN Sales ON Contacts.UniqueID = Sales.UniqueID
WHERE (((Sales.SaleDate) Between [Enter a Starting Date:] And [Enter an
Ending Date:]))
GROUP BY Contacts.UniqueID, Contacts.LastName;

Nov 13 '05 #1
1 1541
laurenq uantrell wrote:

answer in your later post

--
Bas Cost Budde, Holland
http://www.heuveltop.nl/BasCB/msac_index.html
I prefer human mail above automated so in my address
replace the queue with a tea
Nov 13 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Mark Anthony | last post by:
ok so first i will give write the question out, my code, the db structure, then what is going wrong. Write a report to return the top store in terms of Sales Dollars for each month sales have...
1
by: laurenq uantrell | last post by:
I am trying to construct a query that sums sales by salespersons and only returns a list of salespersons that have a sum of sales lower than the previous month for whatever date rane is selected....
4
by: crane.jake | last post by:
Hi, I'm trying to find the following information from the table found bellow. Year_Sales - # of sales that have occurred this year Year_Income - SUM(amount) Month_Sales - # of sales that have...
3
by: owz | last post by:
Working with ACCESS 2000 SQL, I’m getting very frustrated with it now so Any ideas would be well appreciated I want the sum of the sales of a Salesperson for a specific month i.e. the month...
2
by: DavidOwens | last post by:
SELECT DISTINCTROW Format(PERIOD.START_DT,"mmmm yyyy") AS MonthYear, SALES.PERIOD_ID, Sum(SALES.SALES) AS SumOfSALES, Sum(SALES.SALES_UNITS) AS SumOfSALES_UNITS, Sum(SALES.SALES_VALUE) AS...
5
by: wugon.net | last post by:
question: db2 LUW V8 UNION ALL with table function month() have bad query performance Env: db2 LUW V8 + FP14 Problem : We have history data from 2005/01/01 ~ 2007/05/xx in single big...
10
by: Massimo30 | last post by:
Looking for answers and have done a search in books and websites and still can't find the answer: I am setting up a Market Trend DB on housing figures. I have the following fields in my table: My...
1
maxx233
by: maxx233 | last post by:
I need to look at/average some data from every third tuesday of each month during a specific time of day, over the course of the last 2 years. Can anyone think of ways, or recommend something to...
3
antonopn
by: antonopn | last post by:
Hello to all! I'm trying to make a very difficult report. I want to present sales of some products within an year but month-to-month. lets say that the table would be like this... ...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.