SQL Query

I have two Access 2003 tables one is called Forecast and the other is called PartForecast.  One of my users updated the Forecast table when he should of been updating the PartForecast table.  Attached is the database we are using.  I need to move the data he entered from the Forecast table into the PartForecast table for Fiscal year 2015.  Can someone please assist with a SQL query that will accomplish this?  Thanks!
Steve EckermanSystems AdministratorAsked:
Who is Participating?
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.

Steve EckermanSystems AdministratorAuthor Commented:
The db is to large to upload.  I have created Excel sheets of the two tables in question.   Please see attached.
Forecast2015.xls
PartForecast2015.xls
0
hnasrCommented:
Create a copy of the database with just the 2 tables. Delete records leaving few records in each table (say 10 records each). Compact and repair.

Upload the copy and show how to find out which record is updated.

I tried to link the tables but there where too many records to handle. Also I have to make assumptions which the question did not make available.
0
Steve EckermanSystems AdministratorAuthor Commented:
Hello hnasr,  what are your questions and I will be happy to provide the answers.
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

Steve EckermanSystems AdministratorAuthor Commented:
I was able to upload the database.  Please feel free to do whatever you need to do to transfer the data from the Forecast table to the PartForecast table then send me the SQL snytax so that I can transfer the data here.  Thanks!!!
PSI-Budget-2015TEST.mdb
0
chaauCommented:
You need to execute this query:
INSERT INTO PartForecast ( FiscalYear, Mgr, Custcode, PSINO, AnnualVolume, Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, [Dec], Obsolete, PNSI, PRICE, Updatedate )
SELECT Forecast.FiscalYear, Forecast.Mgr, Forecast.Custcode, Forecast.PSINO, Forecast.AnnualVolume, Forecast.Jan, Forecast.Feb, Forecast.Mar, Forecast.Apr, Forecast.May, Forecast.Jun, Forecast.Jul, Forecast.Aug, Forecast.Sep, Forecast.Oct, Forecast.Nov, Forecast.Dec, Forecast.Obsolete, Forecast.PNSI, Forecast.PRICE, Forecast.Updatedate
FROM Forecast
WHERE (((Forecast.FiscalYear)=2015));

Open in new window

And then, after the recods are inserted into PartForecast, delete from Forecast:
DELETE *
FROM Forecast
WHERE (((Forecast.FiscalYear)=2015));

Open in new window

Please make backup before executing these queries
0

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:
Great answer.  Idecided to delete the 2015 records out of the PartForecast table and then ran your SQL syntax and it worked great!!!  Thanks!!!
0
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 Office

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.