Access 2003 Query

Hello Experts,

Attached is my budget database for 2016.  There is a table called PartForecast.  I need a query that will group the Customer Codes and sum the months times the price for Fiscal Year 2016.  Your assistance with this matter will be greatly appreciated.  Thanks and best regards!
Steve EckermanSystems AdministratorAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
Can you show us the query that you've created, and tell us the troubles you're having with it?

Our role is not really to do your work for you, but rather to help you when you run into troubles. We're glad to help, but
Steve EckermanSystems AdministratorAuthor Commented:
The query I created is dated today and is called PartForecastTest it is a select query.  However when I run it the dollar values it generates are not correct.  It is like it is pulling all of the Fiscal Years and not just 2016.
Steve EckermanSystems AdministratorAuthor Commented:
Here is the SQL view SELECT PartForecast.Custcode, Sum([Jan]+[Feb]+[Mar]+[Apr]+[May]+[Jun]+[Jul]+[Aug]+[Sep]+[Oct]+[Nov]+[Dec]*[Price]) AS Expr1, PartForecast.FiscalYear
FROM PartForecast
GROUP BY PartForecast.Custcode, PartForecast.FiscalYear
HAVING (((PartForecast.FiscalYear)=2016));
IT Pros Agree: AI and Machine Learning Key

We’d all like to think our company’s data is well protected, but when you ask IT professionals they admit the data probably is not as safe as it could be.

Steve EckermanSystems AdministratorAuthor Commented:
If the query worked correctly the total dollar value should be approximatley24,133,000.
Move your selection from the HAVING clause to the WHERE clause, like this:

SELECT PartForecast.Custcode, Sum([Jan]+[Feb]+[Mar]+[Apr]+[May]+[Jun]+[Jul]+[Aug]+[Sep]+[Oct]+[Nov]+[Dec]*[Price]) AS Expr1, PartForecast.FiscalYear
FROM PartForecast
WHERE PartForecast.FiscalYear=2016
GROUP BY PartForecast.Custcode, PartForecast.FiscalYear
Steve EckermanSystems AdministratorAuthor Commented:
I tried your suggestion  but the values are still grossly exaggerated.  When I ran it the dollar value equaled $137,502,094.76 when it should be approximately $24,133,000.00.
For testing and validation, remove the GROUP BY clause and the SUM() in the SELECT clause. I like to download data that I need to validate into Excel, which makes it easy to sum an entire column.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Steve EckermanSystems AdministratorAuthor Commented:
I figured out what was causing the issue.  Thanks!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.