How can I do this three steps in the same SQL?

My question is how I can do this in the same issue?
1. Today I do it in three steps. First I create a query, qryWC_ResultList.
2. The query qryWC_ResultList is used in this SQL. Results are saved in tblAppendWC_Quantity
3. Table tblWc updating of the data from tblAppendWC_Quantity
qryWC_ResultList
SELECT MATERIAL, Component From result_list
WHERE INFO = 'UTime'
AND SIGNUM = 'Test'
AND Not Component Is Null
GROUP BY MATERIAL, Component;
tblAppendWC_Quantity
Insert Into tblAppendWC_Quantity (Component, Qty, SIGNUM, Unit)
SELECT Rtrim(Case when qryWC_ResultList.Component Like '4%' Or qryWC_ResultList.Component Like'5%' Then Substr(qryWC_ResultList.Component,1,4) Else qryWC_ResultList.Component End) AS Component,
Sum(result_list.Qty) AS Qty, result_list.SIGNUM,
Case when result_list.INFO Is Null then 'M' Else result_list.INFO End AS Unit
FROM result_list, qryWC_ResultList
WHERE  result_list.Component = qryWC_ResultList.Material
And result_list.Qty > 0
AND result_list.SIGNUM = 'Test'
And result_list.INFO = 'UTime'
GROUP BY Rtrim(Case when qryWC_ResultList.Component Like '4%' Or qryWC_ResultList.Component Like'5%' Then Substr(qryWC_ResultList.Component,1,4) Else qryWC_ResultList.Component End) ,
Case when result_list.INFO Is Null Then 'M' Else result_list.INFO End, result_list.SIGNUM ;
Update table tblWC
UPDATE tblWC set
tblWC.METERS = tblAppendWc_Quantity.Qty,
tblWC.UNIT = tblAppendWc_Quantity.Unit
where tblWC.SIGNUM = tblAppendWC_Quantity.SIGNUM
AND tblWC.COMPONENT = tblAppendWC_Quantity.COMPONENT Edited by: user570142 on 2009-sep-25 06:17

Den Kenny,
Your example is exactly what I want. All temporary queries (views) should creates in the SQL.
But I can't get it work. What is wrong with this?
with qryWC_ResultList  as (SELECT distinct MATERIAL, Component From result_list
              WHERE INFO = 'UTime'
                AND SIGNUM = 'Test'
                AND Not Component Is Null)
,tblAppendWC_Quantity as  (SELECT Rtrim(Case when qryWC_ResultList .Component Like '4%' Or qryWC_ResultList.Component Like'5%'
                    Then Substr(qryWC_ResultList.Component,1,4)
                    Else qryWC_ResultList.Component
               End) AS Component
        ,Sum(result_list.Qty) AS Qty
        ,result_list.SIGNUM
        ,Case when result_list.INFO Is Null
              then 'M'
              Else result_list.INFO
         End AS Unit
    FROM result_list, qryWC_ResultList
   WHERE  result_list.Component = qryWC_ResultList.Material
     And result_list.Qty > 0
     AND result_list.SIGNUM = 'Test'
     And result_list.INFO = 'UTime'
   GROUP BY Rtrim(Case when qryWC_ResultList.Component Like '4%' Or qryWC_ResultList.Component Like'5%'
                       Then Substr(qryWC_ResultList.Component,1,4)
                       Else qryWC_ResultList.Component
                  End)
            ,Case when result_list.INFO Is Null
                 Then 'M'
                 Else result_list.INFO
            End
           ,result_list.SIGNUM)
Select  tblAppendWc_Quantity.Qty, tblAppendWc_Quantity.Unit, tblAppendWC_Quantity.SIGNUM
from tblAppendWC_Quantity
update tblWC set tblWC.METERS = tblAppendWc_Quantity.Qty
                ,tblWC.UNIT = tblAppendWc_Quantity.Unit
where tblWC.SIGNUM = tblAppendWC_Quantity.SIGNUM
   AND tblWC.COMPONENT = tblAppendWC_Quantity.COMPONENT;

Similar Messages

  • Somehow my iTunes app has been put into the trash.  How can I get this and all of the stuff that was in it back to my Application folder?  I try to drag it out of trash, but it won't work.

    Somehow my iTunes app has been put into the trash.  How can I get this and all of the stuff that was in it back to my Application folder?  I try to drag it out of trash, but it won't work.

    Also, when I do try to drag it out of the Trash to put it back into Applications (on the Finder sidebar), it asks me to authenticate with the administration password.  I enter it, and then a window appears saying that I can't do that because I do not have permission to modify iTunes.  Please help.

  • When I facetime the ipad (email address) it calls my phone. The accounts are completely separate. How can I get this to only call the ipad and not my phone as well?

    When I facetime the ipad (email address) it calls my phone. The accounts are completely separate. How can I get this to only call the ipad and not my phone as well?
    It calls both the ipad and iphone when calling the associated email address for the ipad. However, when I call the iphone it does not call the IPAD.
    Thanks for your help

    Are you trying to message another Apple device?
    Using FaceTime http://support.apple.com/kb/ht4319
    Troubleshooting FaceTime http://support.apple.com/kb/TS3367
    The Complete Guide to FaceTime + iMessage: Setup, Use, and Troubleshooting
    http://tinyurl.com/a7odey8
    Troubleshooting FaceTime and iMessage activation
    http://support.apple.com/kb/TS4268
    Using FaceTime and iMessage behind a firewall
    http://support.apple.com/kb/HT4245
    iOS: About Messages
    http://support.apple.com/kb/HT3529
    Set up iMessage
    http://www.apple.com/ca/ios/messages/
    Troubleshooting Messages
    http://support.apple.com/kb/TS2755
    Setting Up Multiple iOS Devices for iMessage and Facetime
    http://macmost.com/setting-up-multiple-ios-devices-for-messages-and-facetime.htm l
    FaceTime and iMessage not accepting Apple ID password
    http://www.ilounge.com/index.php/articles/comments/facetime-and-imessage-not-acc epting-apple-id-password/
    Unable to use FaceTime and iMessage with my apple ID
    https://discussions.apple.com/thread/4649373?tstart=90
     Cheers, Tom

  • TS4148 I have an apple 4 given to me by my cousin from japan but the phone is lock by japan sotfbank, how can i use this phone here in the Philippines network provider? thanks

    I have an apple 4 given to me by my cousin from japan but the phone is lock by japan sotfbank, how can i use this phone here in the Philippines network provider? thanks

    Only the carrier an iPhone was sold as carrier locked with can officially unlock the iPhone. It is my understanding that Softbank in Japan does not unlock iPhones.

  • Hi, I am trying to download IOS7 to my ipad. The programme has locked at the 'Choose a Wif-Fi network' page, a box says 'joining other network' but the page is greyed out and can't move from it.  How can I clear this screen and finish the download. Thanks

    Hi, I am trying to download IOS7 (not sure if it's 1 or 2) to my ipad. The programme has locked at the 'Choose a Wif-Fi network' page, a box says 'joining other network' but the page is greyed out and can't move from it.  How can I clear this screen and finish the download. Thanks

    Hello Den53,
    Thanks for using Apple Support Communities.
    For more information on this, take a look at:
    iOS: Turning off and on (restarting) and resetting
    http://support.apple.com/kb/HT1430?viewlocale=en_US
    Press and hold the Sleep/Wake button for a few seconds until the red "slide to power off" slider appears, and then slide the slider.
    After the device has turned off, press and hold the Sleep/Wake button until the Apple logo appears.
    Best of luck,
    Mario

  • I would like to update my eMac from 10.4.11 to 10.6. How can I get this os version for the update?

    I would like to update my eMac from 10.4.11 to to 10.6.x How can I get this os version for the update?

    Highest an eMac can go is 10.5.8...
    Leopard requirements/10.5.x...
        *  Mac computer with an Intel, PowerPC G5, or PowerPC G4 (867MHz or faster) processor
    minimum system requirements
        * 512MB of memory (I say 1.5GB for PPC at least, 2-3GB minimum for IntelMacs)
        * DVD drive for installation
        * 9GB of available disk space (I say 30GB at least)
    Trouble is appl no longer sells it, you have to search eBay & such for the full retail version, not any grey Install Disc.
    There are workarounds if the 867MHz is the only hangup...
    http://sourceforge.net/projects/leopardassist/
    List of Applications Not Compatible with Leopard...
    http://guides.macrumors.com/List:Applications_Not_Compatible_with_Leopard
    Snow Leopard/10.6.x Requirements...
    General requirements
       * Mac computer with an Intel processor
        * 1GB of memory (I say 2GB at least)
        * 5GB of available disk space (I say 30GB at least)
        * DVD drive for installation
        * Some features require a compatible Internet service provider; fees may apply.
        * Some features require Apple’s MobileMe service; fees and terms apply.

  • How can i do this in Captivate 7 "The idea when user click on "Correct answer" button, drag source m

    How can i do this in Captivate 7 "The idea when user click on "Correct answer" button, drag source move to drop target automatically".

    I suppose you are talking about the D&D interaction? Could you explain more? What is your level of expertise with advanced actions and Effects?

  • I purchased Damages, season 2 from iTunes Store, and I got it in French by mistake. How can I exchange this season, or change the language? (My playback setting was already on English for default language). Thank you, Judith Hamery

    I purchased Damages, season 2,
    from iTunes Store, and I got it in French by mistake.
    How can I exchange this season, or change the language? (My playback setting was already
    on English for default language).
    Thank you,
    Judith Hamery

    Only Apple Account Security could help at this point. You can try calling Apple Support in Canada - you'll have to find one of the several ways, such as Skype, to call an 800 number from outside of the relevant country - and ask for Account Security and see if they can help. Or you can find a friend who speaks Chinese and ask them to help you talk to Apple Support in China. There are really no other options that I know of.
    Note, by the way, that these are user-to-user support forums. You aren't speaking with Apple when you post here.
    Regards.

  • Since updating my iPhone 4 to iOS5, my music stats (play count, last played, etc.) no long sync to iTunes. How can I fix this? Thanks for the help.

    Since updating my iPhone 4 to iOS5, my music stats (play count, last played, etc.) no long sync to iTunes. How can I fix this? Thanks for the help.

    If you have any podcasts in your iTunes library you should see a Podcasts sync setting tab to the right when you connect your phone and click on its name on the left sidebar (see image below).  On this tab check to sync podcasts and sync your phone.

  • How can I set up two iPhones with the same contact, photos, music etc... but a different sim card and phone number. They will both be my phones, but one will be for use in other countries.

    How can I set up two iPhones with the same contact, photos, music etc... but a different sim card and phone number. They will both be my phones, but one will be for use in other countries.

    Phone A = phone with information you want duplicated
    Phone B = phone that you want to copy from A
    Backup Phone A.
    Wipe Phone B using these instructions. What to do before selling or giving away your iPhone, iPad, or iPod touch - Apple Support
    Phone B should be on the 'Hello' screen. Do not swipe it. Launch iTunes. Plug in Phone B.
    When iTunes asks if you want to set up as new phone or restore from backup, choose restore from backup of Phone A.
    After this setup, any changes to one phone (i.e. adding a contact, downloading an app) will have to be manually duplicated on the second phone, if that is your desire). Making changes to one phone will not affect the other after setup.

  • I am uploading receipts using the PURCHASE_ORDER_RECEIPT EIP.  When I upload serialized assets each one is processed as a separate receipt (receiver_id). How can I have these all aggregated on the same receipt?

    I am uploading receipts using the PURCHASE_ORDER_RECEIPT EIP.  When I upload serialized assets each one is processed as a separate receipt (receiver_id). How can I have these all aggregated on the same receipt?
    Is there a parameter I should be using in the XML or is there a setting in Peoplesoft that will accomplish this?
    Jim

    sundy.liu wrote:
    Unfortunately however, even with the TCP tweaks enabled, I still only get a little over 1 Gb/s through the two aggregated Gig ports. It seems as though the aggregation is only using one port, though MRTG graphs of the two switch ports do in fact show that they are both being utilized equally, essentially splitting the 1 Gb/s speed between
    the two ports.
    Problem with the server? switch? Aggregation software? All the above? At any rate, I seem to be missing something.. Any help regarding this issue would be greatly appreciated!If you're only running a single stream, that's all you'll see. Teaming/aggregating doesn't make one stream go faster.
    If you ran two streams simultaneously, then you should see a difference between a single 1G interface and an aggregate of two 1G interfaces.
    Darren

  • How can I run 2 Dreamweaver windows at the same time?

    How can I run 2 Dreamweaver windows at the same time on my
    PC?
    basically I have 2 monitors and I want to edit CSS on one
    monitor and have the html page open on the other so I can quickly
    look from one to another with in a split second instead of taking
    that extra time to switch back and forth using the tabs at the top,
    I know I should probably invest into a mac so i can work out side
    of the Dreamweaver application window and I will in the future but
    is there any way i can do this on my windows XP pro PC?
    Thank you
    Maurice

    Open the CSS in DW, and use F10 to open the Code Inspector.
    Place the
    latter as needed.
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    ==================
    "Random_Yggdrasil" <[email protected]> wrote
    in message
    news:gi2htb$j4j$[email protected]..
    > How can I run 2 Dreamweaver windows at the same time on
    my PC?
    > basically I have 2 monitors and I want to edit CSS on
    one monitor and have
    > the
    > html page open on the other so I can quickly look from
    one to another with
    > in a
    > split second instead of taking that extra time to switch
    back and forth
    > using
    > the tabs at the top, I know I should probably invest
    into a mac so i can
    > work
    > out side of the Dreamweaver application window and I
    will in the future
    > but is
    > there any way i can do this on my windows XP pro PC?
    >
    > Thank you
    > Maurice
    >
    >
    >

  • How can I get my ipad to reflect the same playlist order that appears on my computer?

    How can I get my ipad to reflect the same playlist order that appears on my computer?  My computer has the exact desired order of playlist, but once the system is synced, the ipad does not reflect the propper order.

    In iTunes with your playlist shown in the correct order, right-click on the playlist name in the side-bar and click Copy to Play Order. Enable the side-bar with CTRL+S if necessary. Sync. Note also that the column you are sorting on should have the small triangle pointing upwards, otherwise the songs will play in the reverse order. You may also find that you need to first remove, and then add back the playlist to the device if syncing doesn't update it properly. See this post for more.
    tt2

  • How can install a second app icon  of the same on app on a different home screen?

    how can install a second app icon  of the same on app on a different home screen?
    for example i have the phot app on one home screen and the i want the same photo app showing on the other home screens?
    I want to have a duplicate app on on more than one home screen
    Another example if i have the Evernote app showing on my first home screen and then my last home screen as well

    Put it in the dock at the bottom. Apps put there stay there and show at the bottom of all home screens.

  • How can i create multiple accounts but use the same itunes?

    how can i create multiple accounts but use the same itunes?

    Hi iCloud is Making Me Go Crazy,
    You will need to create a new Apple ID for your GameCenter and iCloud services.  You can continue to use the current Apple ID you share with your Mom for access to iTunes Store purchases if you wish. 
    Using your Apple ID for Apple services
    http://support.apple.com/kb/HT4895
    Frequently asked questions about Apple ID
    http://support.apple.com/kb/HT5622
    Cheers,
    - Judy

Maybe you are looking for