473,434 Members | 1,402 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,434 software developers and data experts.

Choose latest data for report

I am given a sales forecast every month for certain products which
usually extend a year. I enter each forecast into a "tblForecast"
which contains the sales forecast information and the date the forecast
was entered.
On later forecasts, entries are doubled due to overlapping of records
(ie. May 06 sales = 25 (date entered is Nov 05), May 06 sales = 40
(date entered is Dec 05). ForecastMonth, Qty and DateEntered are items
in the table.
I'd like to create a report which only grabs the latest forecast as it
is usually the most accurate. But I want to keep all forecast records
to show accuracy of past forecasts and variances if future forecasts.

What is the best way to create this report?

TIA

Nov 23 '05 #1
1 1390
Something like

SELECT a.ForecastMonth, a.DateEntered, a.Qty
FROM tblForecast a
INNER JOIN (
SELECT b.ForecastMonth, Max(b.DateEntered) AS MaxOfDateEntered
FROM tblForecast b
GROUP BY b.ForecastMonth
) As c
ON
a.ForecastMonth = c.ForecastMonth
AND
a.DateEntered = c.MaxOfDateEntered

--
Terry Kreft

"francophone77" <fr***********@hotmail.com> wrote in message
news:11*********************@z14g2000cwz.googlegro ups.com...
I am given a sales forecast every month for certain products which
usually extend a year. I enter each forecast into a "tblForecast"
which contains the sales forecast information and the date the forecast
was entered.
On later forecasts, entries are doubled due to overlapping of records
(ie. May 06 sales = 25 (date entered is Nov 05), May 06 sales = 40
(date entered is Dec 05). ForecastMonth, Qty and DateEntered are items
in the table.
I'd like to create a report which only grabs the latest forecast as it
is usually the most accurate. But I want to keep all forecast records
to show accuracy of past forecasts and variances if future forecasts.

What is the best way to create this report?

TIA

Nov 23 '05 #2

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

Similar topics

2
by: Scott Baird | last post by:
HELP!!! I've got a DB with two tables (relationships with a autonumber). The database works just fine, but I've got a report I simply can't make work. I've made a query that uses data from...
2
by: misscrf | last post by:
I have a search form that is great. I have modified it in such a way, that when search results come up I can bring it back to a useful spot, say an entry form or a report. Here is my lemon (...
3
by: giloosh99 | last post by:
Hello I have a report that needs to printed by a specific printer rather than the computers default printer? Is there a way to dynamically choose a specific printer to print a report through VBA...
3
by: kathyk | last post by:
Hi All, I am using Access 2003 on machines with windows 2000 and XP. The problem I'm having started only after we got a new image for our PC's. This database app has been around for awhile and...
0
by: francophone77 | last post by:
I am given a sales forecast every month for certain products which usually extend a year. I enter each forecast into a "tblForecast" which contains the sales forecast information and the date the...
1
by: Alan | last post by:
Hello World: I have a new task at work. I have to process a mainframe report (a text file), and put it into an Access 2003 database. When I get the report, it looks like this: Account Sub_Name...
1
by: tonyobrian | last post by:
I'm a definite beginner here, so please excuse me if this has a simple answer. BACKSTORY I work for a nonprofit and we are working to automate the gift acknowledgement process. I currently geta...
0
by: R2d2Rabeau | last post by:
Hi all, I have an application that manipulates excel files without any problem. The problem is for a certain folder where files are giving me an error: When I check those files Excel ask me to...
0
by: mmueller | last post by:
I am new to reporting services 2005 (reporting in Access for years and older versions of Reporting Services from time to time) and this is probably a dumb question... but I have no internal resources...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.