SQL Query Problem

Posted on 2012-08-22
Last Modified: 2012-08-22
I have a query where I am trying to update a field to the new fiscal year with the matching field from the old fiscal year.   It looks like this but it does not work.  Any ideas?

UPDATE [SELECT Mgr, PSINO, FiscalYear FROM PartForecast WHERE FiscalYear=2013; ] AS A INNER JOIN [SELECT Mgr, PSINO, FiscalYear FROM PartForecast WHERE FiscalYear=2012; ] AS B ON A.PSINO=B.PSINO SET A.Mgr = B.Mgr;
Question by:submarinerssbn731

    Author Comment

    Basically what I am trying to do is match the Manager field (Mgr) to the PSI part number (PSINO) they are responsible for from fiscal year 2012 to 2013.
    LVL 119

    Accepted Solution

    lets see if i understood it correctly..

    update PartForecast as A inner join PartForecast as B
    set A.Mgr=B.Mgr
    where A.FiscalYear=2013 and B.FiscalYear=2012

    Author Comment

    That is correct.

    Author Closing Comment

    Great Answer!  Worked like a champ!!!  Thanks!!!

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
    'Between' is such a common word we rarely think about it but in SQL it has a very specific definition we should be aware of. While most database vendors will have their own unique phrases to describe it (see references at end) the concept in common …
    This tutorial will show how to inventory, catalog, and restore media from legacy versions of Backup Exec into both 2012 and 2014 versions of the software. Select Storage from the tabs along the ribbon bar as the top: Ensure the proper storage devi…
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    12 Experts available now in Live!

    Get 1:1 Help Now