Why is this does not add to my amount?

Here is the code I have, with the result below. I want this query to return only the 2 lines for each of the orders of work below so that it adds the amount worked (200 + 150 + 95). Is that what everyone else sees what Miss me? Thank you!
SELECT  
        WORK_ORDER.SITECODE
      , WORK_ORDER_NUMBER AS "WO #"
      , WORK_ORDER.partno
      , WO_PRIORITY AS "PRIORITY"
      , QTY_WORK_ORDER AS "WO QTY"
      , QTY_FINISHED
      , TRUNC(STOCK.DATE_TRAN) AS "TRANS DATE"
      , STOCK.QTY_WORKED AS "QTY WORKED"

FROM
  WORK_ORDER,
 (SELECT 
              sitecode
            , partno
            , SUM(QTY_CHANGE) AS QTY_WORKED 
            , DATE_TRAN
       FROM STOCK_TRAN 
     WHERE SITECODE = 'FCI' 
       AND STOCK_TRAN_CODE = 'P'
      AND TRUNC(DATE_TRAN) = TRUNC(SYSDATE - 2)
     GROUP BY sitecode, partno, DATE_TRAN ) STOCK
     
 WHERE stock.sitecode = work_order.sitecode
      AND stock.partno  = work_order.partno
      AND WORK_ORDER_TYPE = 'K' 
      AND WORK_ORDER.SITECODE = 'FCI'
      AND QTY_FINISHED > 0

     
     AND WORK_ORDER.PARTNO ='270069'                  
           
    
 ORDER BY WORK_ORDER_NUMBER DESC 
Site       WO         Kit        Priority  WOQTY Qty Fin  Trans Date  Qty Changed
FCI     2009501     270069     H     2000           1045     8/16/2011     200
FCI     2009501     270069     H     2000           1045     8/16/2011     150
FCI     2009501     270069     H     2000           1045     8/16/2011     95
FCI     2009500     270069     H     2000           2000     8/16/2011     200
FCI     2009500     270069     H     2000           2000     8/16/2011     150
FCI     2009500     270069     H     2000           2000     8/16/2011     95 

Solution of Azhar will get what you need, but this one is more simple. Subquery just trunc date_tran in your interior.

SELECT
        WORK_ORDER.SITECODE
      , WORK_ORDER_NUMBER AS "WO #"
      , WORK_ORDER.partno
      , WO_PRIORITY AS "PRIORITY"
      , QTY_WORK_ORDER AS "WO QTY"
      , QTY_FINISHED
      , TRUNC(STOCK.DATE_TRAN) AS "TRANS DATE"
      , STOCK.QTY_WORKED AS "QTY WORKED"

FROM
  WORK_ORDER,
 (SELECT
              sitecode
            , partno
            , SUM(QTY_CHANGE) AS QTY_WORKED
            , trunc(DATE_TRAN) date_tran
       FROM STOCK_TRAN
     WHERE SITECODE = 'FCI'
       AND STOCK_TRAN_CODE = 'P'
      AND TRUNC(DATE_TRAN) = TRUNC(SYSDATE - 2)
     GROUP BY sitecode, partno, trunc(DATE_TRAN) ) STOCK

 WHERE stock.sitecode = work_order.sitecode
      AND stock.partno  = work_order.partno
      AND WORK_ORDER_TYPE = 'K'
      AND WORK_ORDER.SITECODE = 'FCI'
      AND QTY_FINISHED > 0

     AND WORK_ORDER.PARTNO ='270069'                  

 ORDER BY WORK_ORDER_NUMBER DESC

Tags: Database

Similar Questions

  • Final score does not add...

    I made a game where catch you things that each have their own score individual, when you take one, a map will appear showing the details of this thing (displayClip). In this displayClip, there is a dynamic text box that has the amount applies for the score. He then gets sent to the final score. Everything just works how it should, EXCEPT for the fact that the just amount GET exchanged with the latter amount, added not? I thought ' score += Number (a); "would do it... anyone with any idea why it does not add to the top? Would be very grateful for any help.

    var displayClip = attachMovie (thing.style, thing.style, d);
    var a = displayClip.amount.text;
    var score = 0;
    score += Number (a);
    total.set_Text = score + "kr.";

    Make sure that you set no partition var = 0 whenever the case if the score is 5, for example, if you get 5 points higher the score will be set back to 0 until the points are added - which would result in the problem you are experiencing. declare the variable outside the function.

    Otherwise post the full script or a link to the fla
    --
    JAMES

  • Firefox on Windows. When I click on a link, Firefox hangs up with a rotating cursor. Problem goes away by moving the mouse. This does not happen with IE.

    Using Firefox 27.0, when I click on a link, a rotating cursor appears and continues to run. Move the cursor will solve the problem. I had this problem for several versions of Firefox, and I use automatic updates.

    Please update Firefox, troubleshoot Add - ons and if this does not help, then do a clean reinstall.

    Thank you!

  • Since last week, when I have several windows open in firefox, the pages back and forth between windows open by themselves. This does not happen when I use tabs instead of windows, however.

    window 1: gmail (example only)
    window 2: facebook for some company (example only)
    I will review my email and the screen suddenly changes the Facebook to say P & G for example.
    If I tab1 as gmail, tab2 as facebook P & G, it won't happen.
    And it only happens in Mozilla Firefox. When I use IE, that's fine.

    What Windows platform should not make a big difference. The screenshot may appear as coming from an older version of Windows, but the basics should be the same.

    If this does not work in mode without failure, then disable all extensions and then try to find out who is the cause by allowing both the problem reappears.

    • Choose "Disable all add-ons" on issues to troubleshoot Firefox in Safe Mode to set window to disable all extensions.
    • Close and restart Firefox after each change through "file > exit ' (Mac: ' Firefox > leave";) Linux: "file > exit ')
  • Why my iMac does not recognize my scanner 1600 epson perfection since the upgrade to ElCapitan 10.11.4?

    Why my iMac does not recognize my scanner Epson Perfection 1600 since the upgrade to ElCapitan 10.11.4?

    First try this: reset the printing on your Mac - Apple Support System

    If this fails, you can try this driver: http://www.epson.com/cgi-bin/Store/support/supDetail.jsp?oid=14577 & infoType = Down load

  • Why my printer does not print with Windows 8?

    Why my printer does not print with Windows 8?

    Did you just upgraded or purchased a new computer with Windows 8, and now you can't get your printer to work?  If so, this can help you.  Many people have questions about the installation of their printer on a new OS.  This will help you answer these questions and make sure you get everything installed.

    Before you start

    Before you try to install the printer on a Windows 8, you should check to make sure that the printer is compatible with the new OS.  The link below will give you a list of printers that will work in Windows 8.

    http://support.HP.com/us-en/document/c03168175

    If you have upgraded your computer to Windows 8 formed another version of Windows, make sure all software uninstall complete of your printer.  It should still print, but to use all the features, you will need to reinstall the software, if available.

    Another thing to consider is how you want to connect the printer to the computer.

    1. USB.  You must ensure that you have a USB cable which does not exceed 6 feet (about 2 m).  Be sure to connect the printer directly to the computer.  Do not use a USB hub.

    2. Ethernet cable.  Make sure you have the network configuration, you have a free cable port on the router, and you have an available Ethernet cable.

    3. Wireless.  You must ensure that you have the configuration of the wireless network, and you have the password of the wireless network.

    1. installation Via USB

    Installation via USB in Windows 8 became much simpler for users of HP printer.  In other versions of the Windows operating system, you need to launch the installation and wait that it asks for the USB connection.  If you do not, you will need to uninstall the printer from the devices and printers folder and then launch the installation.  In Windows 8, which won't be a problem.  If you plug the USB cable from the printer and then install the printer software, work remains.  Now for in depth instructions on installing the printer via the USB port click on the link below.

    http://support.HP.com/us-en/document/c03521864

    2 installation Via an Ethernet network connection

    For an Ethernet connected printer, the installation is disconcerting.  All you have to do is to connect the printer to the network.  Once you have done so, Windows 8 will automatically install the drivers for you.  Then, all you have to do is install the rest of the software, if available.  It's really as simple as that.

    http://WWW8.HP.com/us/en/support-drivers.html

    3 installation Via a wireless network connection.

    For a wireless printer, network installation is disconcerting.  All you have to do is to connect the printer to the network.  Once you have done so, Windows 8 will automatically install the drivers for you.  Then, all you have to do is install the rest of the software, if available.  It is roughly the same as just Wireless Ethernet installation.

    http://WWW8.HP.com/us/en/support-drivers.html

    Alternative installation methods

    With Windows 8, the drivers of many printers are installed with the operating system.  These are called pilots InOS, since they come built-in to the operating system.  If you have one of these printers, you should have to do simply connect it to the computer via USB, or connect to the network via Ethernet or wireless.  Once you have that makes Windows will take care of the rest.  There are other methods of installation of your printer if normal methods don't work for some reason any.  You can install the printer is using the printer, or through Windows Updates Setup Wizard.

    Set printer wizard:

    http://support.HP.com/us-en/document/c02681060

    Windows Update:

    http://support.HP.com/us-en/document/c03460648

    Note: The drivers of Laserjet for the Asia-Pacific and the Japan will come only at a later date.  See below the link support site for the availability of the driver.  I will update this post once they become available.

    http://WWW8.HP.com/us/en/support-drivers.html

    Hope that answers some questions.

  • Why CRYSTAL_REPORT program does not work with windows Vista? __

    Why CRYSTAL_REPORT program does not work with windows Vista?

    http://www.Microsoft.com/Windows/compatibility/Windows-Vista/default.aspx

    Windows Vista Compatibility Center

    First thing to do is to check its Vista compatibility at the link above, and if not to see what patches/solutions are available from its manufacturer...

    http://www.howtogeek.com/HOWTO/Windows-Vista/using-Windows-Vista-compatibility-mode/

    If this is not Vista compatible, read the info on the link above.
    It works for some programs, but not all.

    This applies to software programs, NOT hardware drivers.

    If it's Vista compatible > uninstall it > Re-download/save to your desktop > right click on the setup.exe > run as admin.

    See you soon.

    Mick Murphy - Microsoft partner

  • Why my PC does not install updates? Although located to automatically receive my last update was February 2015 and all others have failed.

    Original title: updates

    Why my PC does not install updates? Although located to automatically receive my last update was February 2015 and all others have failed.  Although I tried to reset nothing help.

    Have also tried to download Windows 10 but computer spends all day looking for updates, but nothing happens.

    As its been almost a year that it is updated, you may be better off to backup your data and backup of your entire system, so you can get back to this point at least if something goes wrong. Then:

    Update your anti-virus software and run a full scan. Then download, install, update and run a full scan with Malwarebytesfree. Keep it free, no need to start a trial etc. Malware can be a cause of failure of the updates, the scan won't take long to run and should report something nasty, if its there.

    Then you can try the following:

    1 convenience store update Windows - http://windows.microsoft.com/en-US/windows7/Open-the-Windows-Update-troubleshooter

    2 system update readiness tool - http://windows.microsoft.com/en-us/windows7/what-is-the-system-update-readiness-tool

    3 components of reset update - https://support.microsoft.com/en-us/kb/971058

    4. check that "Windows update service" and "Background Intelligent Transfer Service" are listed and running according to the details in this article - https://support.microsoft.com/en-us/kb/2730071 "

    If the above does not help, consider trying a 'repair installation system' - http://www.sevenforums.com/tutorials/3413-repair-install.html if you have windows installation discs, or a 'factory reset' (updated) If your PC came with no windows disk and was preinstalled. NOTE - in case backup your data and your system first in the form of data may be lost if something goes wrong, and data will be lost in the case of a factory reset.

    If you do not want to reinstall again, post back with more details, that is at least what is the error code when the updates fail? (find an update failed in "view history update", right click and click details.) Check a bit to see if the same error code. ). Then someone else can we hope to help more.

  • Why my pc does not work no matter what .exe? I couldn't even run diagnostics

    Why my pc does not work no matter what .exe? I couldn't even run diagnostics

    Hi SteliosArmenis,

    Thank you for keeping us posted on the State of the question.

    I see there is that the antivirus installed on the computer could not detect infections. To ensure that the computer is clean, we can run a thorough scan using Windows Defender in offline mode.

    I suggest to download Windows Defender Beta offline to a flash drive, CD, DVD or USB and then perform the steps.

    The articles explain how to create a disk and run the scan.

    NOTE: the program must not not to be run / run from the office.

    http://Windows.Microsoft.com/en-us/Windows/what-is-Windows-Defender-offline

    http://Windows.Microsoft.com/en-us/Windows/Windows-Defender-offline-FAQ

    Note: the data files that are infected must be cleaned only by removing the file completely, which means there is a risk of data loss.

    Hope the information is useful. If you need help with this problem, feel free to post you question in the forum. We will be happy to help you.

  • Win Anytime Upgrade to Windows 7 Ultimate Home Prem key and it does not add text prediction in on-screen keyboard

    I used my Windows 7 Ultimate on Windows Anytime Upgrade key on my Home Premium and it does not add text prediction in on-screen keyboard... Can I fix?

    I haven't seen someone else pointing out this problem and have no knowledge of the topic other than the behavior I saw on my own system.

    That being said, Windows 7 help & how-to text prediction is available in all editions of Windows except Windows 7 Home Basic Edition [English, French, Italian, German, Spanish] 7.

  • Why channel Volume does not appear in the Panel of the applied effects (first 12 elements trial version)?

    Hi people

    doew anyone know why Channel Volume does not appear in the Panel of the applied effects (first 12 elements trial version)?

    Thank you very much in advance

    Adam

    adamPREMIERE

    I have the book, but this screenshot has been extremely help.

    The answer is...

    Like I said, the default Panel in the range of effects of applied effects/Applied / Motion and opacity.

    Once you apply fx effects Audio/Effects/Channel Volume effect to your audio clip, you will see the channel Volume Panel in the Palette of effects applied and the movement and opacity.

    I'll give you screenshots if necessary.

    Please try to prove guilt.

    Thank you.

    RTA

  • Why color Temp does not use theory standard blackbody in lightroom?

    Hi all, I would like to ask a question. Why the temperature in Lightroom does not use theory standard blue witch bsigns black body for higher values and the red ones for lower values on the kelvin color temperature scale?

    I'm not a novice and a motion graphic designer and 3D generalist and I do not understand why the Lightrooms does not use the normal scale. You go to a 3D ap and if you are familiar with lightroom you will have some problems whit lighthning because in all the 3d points and from what I've seen other counters aps use the kelvin color temperature values, higher values are asigned to blue spectrum. For example, with a bulb (D65) of natural light has a value of 2700 Kelvin is the red color red but in lightroom is on the opposite side and 2700 you have a tint of blue. I personally find very annoing this approach and I would like to ask Adobe if they could put an option to change the color temperature scale Kelvin standard.

    Thank you

    http://en.Wikipedia.org/wiki/Color_temperature

    Cursors do not set the light black body temperature, but compensation requested the image to compensate for the temperature of the black body of light.  This is going the other way.

    If a picture is taken in tungsten (light that is yellow-ish), we always want to look white 'white' when view us on a screen (as our eyes compensate for the color temperature of the ambient lighting).  To adjust to the lighting low temp black body (i.e. yellow-ish), so we want to make the image more blue, so it does not yellow.  Until the lower part of the blackbody temp lighting (i.e. more yellow enlightenment), the more blue the compensation that we must apply.

  • Why is this work not running?

    Why is this work not running?
    SQL> BEGIN
      2  DBMS_SCHEDULER.RUN_JOB('EXCHANGE_PART_JOB');
      3  END;
      4  /
    BEGIN
    *
    Error in line 1:
    ORA-00911: invalid character.
    ORA-06512: in "SYS.DBMS_ISCHED", line 150
    ORA-06512: in "SYS.DBMS_SCHEDULER", line 441
    ORA-06512: in line 2
    This work follow these steps:
    CREATE OR REPLACE PROCEDURE Exchange_Partition IS
    Sql_Exchange VARCHAR2(2000);
    BEGIN
    Sql_Exchange := 'ALTER TABLE HR.GPS_LOG_HIS EXCHANGE PARTITION '||
    'udp_part'||TO_CHAR(SYSDATE-1/24,'YYYYMMDDHH24')
    ||' WITH TABLE HR.GPS_LOG';  
    EXECUTE IMMEDIATE Sql_Exchange;
    END;
    /
    Use the following program:
    BEGIN
      DBMS_SCHEDULER.create_program (
        program_name        => 'exchange_part_prog',
        program_type        => 'STORED_PROCEDURE',
        program_action      => 'EXCHANGE_PARTITION',
        --Use a database directory to replace the OS directory.
        number_of_arguments => 0,
        enabled             => TRUE,
         comments            => 'Program to exchange partitions for hr.gps_log_his table or other tables
                                 use a shell script.');
    END;
    /
    Use the following code to create the work:
    BEGIN
      DBMS_SCHEDULER.create_job (
        job_name      => 'exchange_part_job',
        program_name  => 'exchange_part_prog',
        schedule_name => 'exchange_part_hourly_schedule',
        enabled       => TRUE,
        auto_drop     => false,
        comments      => 'Job defined to exchange partitions for gps_log_his table or orhter tables.');
    END;
    /

    Ok

    ORA-14099: all rows in the table are not eligible for the specified partition
    Cause: There is at least one line in the non-partitioned table which does not qualify for the partition specified in the PARTITION of EXCHANGE ALTER TABLE
    Action: Ensure that all the lines in the segment qualify for the partition. Perform the operation table alter with the NO CHECK option. Run ANALYZE table VALIDATE on that partition, namely the invalid rows and delete them.

    I think you should check the data in gps_log, some lines must belog to another partition?

    Concerning
    Peter

  • Why the network does not work after update to ios10?

    I can't make and receive calls. In addition, I can't send and receive messages.

    Reset your network settings. Tap Settings > general > reset > reset network settings. This also resets the Wi - Fi networks and passwords, cell parameters and VPN and APN settings you used before.

    If this does not help, try here > If you can not connect to a cellular or cell - data Apple Support Network

  • Whenever I run Safari my fan comes at top speed and gets hot.  This does NOT happen with Firefox

    Since I upgraded to El Capitan, when I launch Safari, my fan is running hot, CPU goes into battery and use 100% drops quickly.  This does NOT happen with Firefox.

    Force Quit Safari and then restart Safari while holding down the SHIFT key. This will launch Safari without plugins or extensions. If works in Safari you have to remove all extensions you have installed and reinstall better one at a time until you find the offending Safari extension.

Maybe you are looking for

  • using the scanner

    How can I scan a documents with my hp print 6520? I need a particular program or service is already inserted in the printer? Thank you

  • Compaq nx6325: Compaq nx6325 charger

    I have a Compaq nx6325 laptop and the original charger has disappeared. I have a cheap replacement charger that is 18.5V and 3.5Amp but now the plug of the charger is messed up and sometimes it will not charger. I have a HP charger with a part number

  • setting programmatically toggle the value of the button?

    Isn't this possible? I looked at help for the SetCtrlVal() and the SetCtrlAttribute(), and it doesn't look like it can be done. True? My app has a command button to clear the displayed graph. It would be nice that the first steps of the function to s

  • While trying to install windows updates, I get an error 57F Code - Windows Update encountered an unknown error.

    For months, that I tried to install windows updates and continually get 57F error Code - Windows Update encountered an unknown error.  I'm now 9 updates important and 2 Optional updates that have failed to be updated.  I am running Windows Vista Home

  • Why my Dell laptop freezes so often?

    My laptop crashes maybe every 20 or 30 seconds for about 10 to 15 seconds. It does not matter what I do if I am on the internet or if I use some software.  I checked for malware and viruses.  I tried patches from microsoft.  I have 60 gigs of space o