Union All is not bring the second part columns to the report

I have 5 groups of series of Select statements and then I made a UNION ALL after the first group. Now it does run correctly and displays the output but it does not assign the second group' s field names.
For example. I am greatly abridging
Completed the SQL's needed to mimic a IBM i display screen. There are 5 product groups making up the screen. I was hoping to have one large Command SQL having the 5 SQLs using UNION ALL. This does 'compile' as a Command. However, it does only brings in the first part fields not the second. So this field is not included in the list of fields tree for COMMAND. PROGR2R2PST,
Is there something not correct how doing the UNION ALL? OUTPUT assigns the column name
of the first group to the second group. HLDGR1PUN 21454 87273
so if i wanted to have one large SQL with union ALLs, it wont work. is there something other than UNION ALL I should use? One idea is if I can have 5 commands to my disposal. I guess  using subreports you can but it will be too slow.
SELECT
count(*) as PROGR1PST,
SELECT COALESCE(SUM(OdQty#),0)
FROM ASTCCDTA.OEORH48,ASTCCDTA.TRNSTAT2,ASTDTA.OEORD1
WHERE OHCOM# = TSCOM# AND OHORD# = TSORD# AND OHCOM# = ODCOM# AND OHORD# = ODORD#
AND TSSTAT IN('AEP','BGE')
AND OHORDT IN('RTR','INT','SAM')
AND OHREQD < replace(char(current date, iso), '-', '')
AND OHHLDC = ' '
AND ODPRLC = 'ENG'
AND substr(odprt#,1,5) <> 'NOENG' AND OHORD# in(SELECT a.TSORD# FROM ASTCCDTA.TRNSTAT2 a
WHERE a.tsstat IN('AEP','BGE','EAS','REL','STP'))
) AS PROGR1PUN,
SELECT count(*)
FROM ASTCCDTA.OEORH48,ASTCCDTA.TRNSTAT2,ASTCCDTA.OETRA99
WHERE OHCOM# = TSCOM# AND OHORD# = TSORD#
AND (otCOM# = OHCOM# AND OTORD#= OHORD# AND ottrnc = 'AQC')
AND TSSTAT IN('AEP','BGE')
AND OHORDT IN('RTR','INT','SAM')
AND OHREQD = replace(char(current date, iso), '-', '')  AND OHHLDC = ' ' AND OHORD# in(SELECT a.TSORD# FROM ASTCCDTA.TRNSTAT2 a
WHERE a.tsstat IN('AEP','BGE','EAS','REL','STP'))
) AS PROGR1TOD,
etc..
UNION ALL
SELECT
count(*) as PROGR2R2PST,
(SELECT COALESCE(SUM(OdQty#),0) FROM ASTCCDTA.OEORH48,ASTCCDTA.TRNSTAT2,ASTDTA.OEORD1
  WHERE OHCOM# = TSCOM# AND OHORD# = TSORD# AND OHCOM# = ODCOM# AND OHORD# = ODORD#
  AND TSSTAT IN('AEP','BGE')
  AND OHORDT IN('CUS','CIN','SMC','COC','DON')
  AND OHREQD < replace(char(current date, iso), '-', '')
  AND OHHLDC = ' '
  AND ODPRLC = 'ENG'
  AND substr(odprt#,1,5) <> 'NOENG' AND OHORD# in(SELECT a.TSORD# FROM ASTCCDTA.TRNSTAT2 a 
WHERE a.tsstat IN('AEP','BGE','EAS','REL','STP'))
) AS PROGR2PUN,

hi Paul,
a union combines record sets like this
field1     field2
1          2
union
field3     field4
2          8
will produce
field1     field2
1          2
2          8
note that there are no more field3 & field4 names. that's the way a union works.
if you need separate fields for your other values then you would need to use sub-queries instead. to do that delete "UNION ALL " and create sub-queries with anything that is beneath that statement.

Similar Messages

  • After I updated user for i phone 4 s iCloud password is no way I can not phone and e-mail address has been blocked. I did not bring the solution to Turkey APPLE chief BILKOM is forgotten the password and e-mail address in the e-mail address asking for hel

    After I updated user for i phone 4 s iCloud password is no way I can not phone and e-mail address has been blocked. I did not bring the solution to Turkey APPLE chief BILKOM is forgotten the password and e-mail address in the e-mail address asking for help from you I will make the iphone does not open e-mail address associated with it @hotmail.com mail to this address icloud iphone phone's password is forgotten, I want to thank you in advance for your help tell a method of opening up again.
    <Email Edited by Host>

    Welcome to the Apple Community.
    I have asked for your email address to be edited out. Posting your address in an open thread is a sure way to be bombarded by unwanted email, remember it will be here long after you have resolved your problem, for automated detection software to find.
    If you want people to contact you, enable others to see your email address in your profile.
    This feature has been introduced to make stolen phones useless to those that have stolen them.
    However it can also arise when the user has changed their Apple ID details with Apple and not made the same changes to their iCloud account/Find My Phone on their device before upgrading to iOS 7.
    The only solution is to change your Apple ID back to its previous state with Apple at My Apple ID, verify the changes, enter the password as requested on your device and then turn off "find my phone".
    You should then change your Apple ID back to its current state, verify it once again, delete the iCloud account from your device and then log back in using your current Apple ID. Finally, turn "find my phone" back on once again.
    Apple Topluluk hoş geldiniz.
    Ben düzenlenebilir için e-posta adresi için istedi. Açık bir konu adres gönderme istenmeyen e-posta ile bombardıman bir emin yoludur, bulmak için otomatik algılama yazılımı için, size sorunu giderilmiştir sonra burada uzun olacak unutmayın.
    Eğer insanlar sizinle iletişim istiyorsanız, başkalarının profilinizde e-posta adresinizi görmelerini sağlar.
    Bu özellik onları çalıntı olduğunu bu işe yaramaz çalıntı telefonları için getirilmiştir.
    Ancak aynı zamanda kullanıcı Apple ile Apple ID ayrıntıları değişti ve iCloud hesabı için aynı değişiklik yapmamış ortaya çıkar / iOS 7 yükseltmeden önce cihaz üzerinde My Phone bul olabilir.
    Tek çözüm My Apple ID de Apple ile önceki durumuna geri Apple ID değiştirmek için, değişiklikleri doğrulamak cihazınızda talep olarak, şifreyi girin ve sonra kapatın "benim telefon bulmak".
    Daha sonra tekrar bugünkü durumuna Apple ID değiştirmek gerekir, bir kez daha doğrulamak cihazınızdan iCloud hesabı silmek ve daha sonra mevcut Apple kimliği kullanarak oturum açın. Son olarak, geri bir kez daha üzerinde "benim telefon bulmak" açın.

  • Bugreport: Seed updates all languages, not only the selected one

    I just encountered a "Bug" when seeding a multilingual translation.
    It looks as if SEED would insert only values for the chosen language mapping (good!), but in case of an update overwrite the values in all languages, not only the chosen one.
    I know it is not that bad, but causes some irregular statistics after seeding.
    e.g. my applications main language is "eo", language mappings for "en", "de", "es".
    When i change a single text (e.g. button label) in the main app and do a seed for "en" i get "3 existing attributes updated and may require translation" (because there are 3 languages...). when i do a seed for "de" right afterwards i get "0 existing attributes updated and may require translation".
    brgds,
    Peter
    Blog: http://www.oracle-and-apex.com
    ApexLib: http://apexlib.oracleapex.info
    BuilderPlugin: http://builderplugin.oracleapex.info
    Work: http://www.click-click.at

    Apparently you have more choice than you are aware of. Thunderbird has three ways to sear messages.
    I am guessing from what you say that you want to '''find''' (Ctrl + Shift + F) instead of '''global search''' (Ctrl+K) or '''quick filter''' (Ctrl + Shift + K)
    Note that global search offers options
    <img alt="" src="https://support.cdn.mozilla.net/media/uploads/images/2014-08-25-16-49-59-21b72c.png" height="106" width="217">
    First your messages
    Then the internet
    Then people in your address book
    ''Yes I know your a mac user, but they tell me macs have a CTRL key these days an you do not need to use3 command''

  • I recently did a "over the air" sync with my notes to my email account and when i did i didnt get back all my notes, could the other notes be in another location?

    i recently did a "over the air" sync with my notes to my email account and when i did i didnt get back all my notes, could the other notes be in another location?

    Go to Settings>iCloud and set up the iCloud account you were using before by singing in with the same Apple ID.  Then turn the data you were syncing with your iCloud account back to On, and if prompted, choose merge.

  • Is there any way to lock an IPAD app? by lock, I don't mean password protect.  My toddler is constantly scrolling out of her apps and this causes frustration as she spends all her time bringing the IPAD back to me to get back in to the app she was playing

    is there any way to lock an IPAD app? by lock, I don't mean password protect.  My toddler is constantly scrolling out of her apps and this causes frustration as she spends all her time bringing the IPAD back to me to get back in to the app she was playing.  I need a SCROLL lock!!

    This may help: iOS: Understanding multitasking.
    If you turn OFF multi-taskng, your toddler won't be able to "swipe" between Apps.
    I don't know of any way to disable the "Home" button though.

  • PAYABLES NOT GETTING THE REPORT OUTPUT IN PDF AFTER APPLYING RUP5 R12

    Hi All,
    RDBMS:10.2.0.3.0
    Oracle Apps :12.0.4
    OS:AIX 5.3
    Problem Description:
    We are presently facing an issue in Payables not getting the report output in PDF esp for the reports "Invoice Register", Invoice Hold Report and also other reports. We were able to generate the reports till our last test performed on last Thursday. This instance was cloned over the last weekend and probably the new upgrade to RUP5 R12,would have impacted it.
    Concurrent Programs submitted are completed normal but on clicking "view output" results in Blank PDF output.
    The error message what was shown is as below:
    "Adobe Reader could not open 'AcrC.tmp' because it is either not a supported file type or because the file has been damaged (for example, it was sent as an email attachment and wasn't correctly decoded)".
    Where could we locate ther above 'AcrC.tmp' of Adobe Reader..
    could anyone please share such an experience encountered for resolution..
    Would appreciate an early response..
    Thanks for your time!
    Regards,

    I suggest you speak to your DBA/sysadmin. This is not likely to be a reports problem.
    Check that you can see the output from apps through the viewer (the report may not hav output anything)
    Check whether you can print anything on that printer from apps.
    May also be worth checking to see if you can print to another printer from this report.

  • Notes in the report

    Hi
    We would like to add Account Notes part of reporting field. Is there any direct way or work around to include Notes in the reports.
    Sundar

    Hi, You can think about using a custom object along with description field to meet the reportable notes requirement. Standard notes field is so far not exposed through reporting
    -- Venky CRMIT

  • Can not see the report in report manager/admin tab

    Hi,
    in 8.49 on Win 2003 some users can not see the reports in report manager/admin tab. PS user can see them.
    Should we add some grants in user profile ? Which ? Any query to compare that user profile with PS ?
    Thank you.

    On the administration page, you will be able to see "View Reports For" header on the top.
    Under that header you will see the following fields:
    User ID/Type/Last/Status/Folder /Instance
    Above values will be used by PeopleSoft to filter and display the list of reports
    If the user has selected Status as Processing and saved the page, PeopleSoft will only show reports which are in Processing status.
    If user runs a report and it has been posted, it will not show up in report manager coz the filter value is set to Processing.
    Hope this helps. I dont think Permissions has anything to do with this since user is able to view the page.

  • Crystal Report Runtime Error 9.0.Could not open the report

    Hi,
    Getting the Crystal Report Runtime Error 9.0.Could not open the report while Run on Launch Application. Actually in Launch Application, created a link for exe which is having crystal reports. We can open the Crystal Reports from the exe outside B1.
    Note: SAP 2007, Crystal Report 2008 is using.Normally can open crystal report.
    Any help to fix the error is appreciated.
    Thanks & Regards,
    Parvatha Solai.N

    Hi,
    Please post screen shot of error message here.
    Thanks & Regards,
    Nagarajan

  • CiscoWorks LMS 4.0.1 - Could not generate the report

    Hello,
    I am running CiscoWorks LMS 4.0.1 since 6 months and I wanted to generate today a report about the interface utilization on 2 Cisco switches (Catalyst 3750G). The corresponding job is created, it runs and then i get "succeeded with info" in the "Run Status" column. When I want to click then on the "View Report" link, I get the following error: "Could not generate the report. Either data is not available for the specified duration or the report job failed."
    I tried the same procedure with 2 other switches but I have got the same result.
    Does anybody has an idea of how I can fix this issue?
    Thanks a lot in advanced.
    Best regards,
    Marc Hoffmann

    Hi Marc,
    I have this problem too. I rebooted my Windows but no solved. You known the service name responsible for this error? You have any other sugestion?
    Thank you !!!

  • Online Report Server did not send the report data. (Error: BAW 0059)

    Can someone confirm me if we can create an e-mail publication for promt based reports? I was created publications for non-prompt based report and they were successful. But when I create a publiction for an report which has prompt I am gettign the error - Online Report Server did not send the report data. (Error: BAW 0059). Any ideas?
    --Nivas

    I forgot to mention the envionment, which is 6.5.1

  • Inventory on Hand Report - Using Union ALL - need two fields to be part of the group

    Hi all,
    I have created an Inventory "on Hand" Report that takes the Current Inventory from the Item Entry table and the Sales from Unposted Sales Line table and Transfers in and out from the Unposted Transfer Line table.  I have joined the tables
    using the UNION ALL function. 
    My problem is that the Transfer table has two locations whereas the other tables only have one.  I am grouping on Location code from the Item Entry table which is equivalent to BOTH Transfer from location and the Transfer to.    
    As an example, there are 15lbs of inventory for Product A in Location #1 with a transfer out of 15 lbs.  The Transfer out is going to Location #2
    I don't know how to write the query or set up the group so that it recognizes both the Transfer to and the Transfer From fields
    I want the report to look similar to the one below but I can only get it to show one of the locations.  Is there some way to use the Union function and have one field in the first table be or equivalent to two fields in another?
    Location   Code
    Item No.
    Lbs
    Sales Orders
    Transfer Out
    Transfer In
    Available   Inventory
    Location #1
    Product A
    15
    -15
    Location #1
    15
    -15
    Location #2
    Product A
    15
    15
    Location #2
    15
    15

    Hi Igor,
    You can get a custom sort order added to your IP column without the need for a second column.
    Consider that the sorting is done strictly left-to-right across a string in the column. The string can be any valid HTML content. So, you could wrap your string within, say, a SPAN tag and add an attribute to that tag that contains the sort order you need before the text that is displayed to the user. As long as the attribute is correctly structured (that is, all instances are of the same length, for example), then sorting will work correctly. For example:
    SELECT
    '<span title="' || PAD_IP_ADDRESS(IP) || '">' || IP || '</span>' Y
    FROM ...Now you need to ensure that the PAD_IP_ADDRESS() function returns the correct values. In IP addresses, you have anything from "0.0.0.0" to "255.255.255.255". To get them to sort "numerically", you need to pad one or two digit numbers to get three digit numbers for each value - so, "0.0.0.0" becomes "000.000.000.000". You could create a function to do this - something like:
    CREATE OR REPLACE FUNCTION PAD_IP_ADDRESS
      pIP IN VARCHAR2
    RETURN VARCHAR2
    IS
      vIP VARCHAR2(15);
      vTEMP APEX_APPLICATION_GLOBAL.VC_ARR2;
      vSEP VARCHAR2(1);
    BEGIN
      vSEP := '';
      vIP := '';
      vTEMP := APEX_UTIL.STRING_TO_TABLE(pIP,'.');
      FOR x IN 1..vTEMP.COUNT
      LOOP
        vIP := vIP || vSEP || TRIM(TO_CHAR(TO_NUMBER(vTEMP(x)),'000'));
        vSEP := '.';
      END LOOP;
      RETURN vIP;
    END;The output from this would look something like:
    &lt;span title="001.001.001.001"&gt;1.1.1.1&lt;/span&gt;
    &lt;span title="002.255.255.255"&gt;2.255.255.255&lt;/span&gt;
    &lt;span title="010.001.199.098"&gt;10.1.199.098&lt;/span&gt;Andy

  • Close tab groups actually closes tabs rather than just the grouping. How do I recover all tabs, not just the last 10? Pages and tabs are not in recent history.

    I had a problem with tab groups - if I mistakenly close tab groups, I can only recover the last 10 tabs.
    I had a window with many more than 10 tabs which I reopened each session by going to History > Recently Closed Windows. I knew this was risky - I could lose this if I did not keep it in an open window or recently closed window. So I was looking for a way to save this window with all the tabs. I looked into tab groups and, not knowing what I was doing, I closed the groups of tabs. There seems to be no recovery for other than the last 10 tabs. And open tabs are not necessarily in recent history if I have not accessed the tab and refreshed.

    I don't use tab groups myself, but I know of a way to increase the number of closed tabs that Firefox remembers. Unfortunately, it's not retroactive...
    (1) In a new tab, type or paste '''about:config''' in the address bar and press Enter. Click the button promising to be careful.
    (2) In the search box above the list, type or paste '''sess''' and pause while the list is filtered
    (3) Double-click the following preferences and enter the preferred new value:
    (A) '''browser.sessionstore.max_tabs_undo''' (default: 10)
    (B) '''browser.sessionstore.max_windows_undo''' (default: 3)
    Regarding what is in history, by default, Firefox will load tabs on demand when you restore a session, rather than loading every single tab immediately. If you turned off that setting, or if you visited all the tabs, then those pages should be in history, but finding them amidst all the others would be quite a challenge...

  • When I plug my iPhone into my computer it doesn't show up at all. Not on the computer or iTunes nor does it charge when plugged into the computer. It charges just fine when it's plugged into the wall .

    When I plug my phone into the computer nothing happens. The phone doesn't respond the computer doesn't show anything and ITunes doesn't show anything!

    I would not worry too much about the charging aspect of the computer connection for now.  I did notice that the last time I connected my iPhone to my computer the iTunes had changed and the only way I could determine that my iPhone was connected was by noticing a box at the upper right on the computer screen vs. the older graphical interface which showed the connected iPhone in a column on the left of screen.  My iPhone did not turn on and did not charge.  However the iPhone was connected and I could in-fact select Sync from one of the iTunes pull-down menus.  Again, for quite some time I though my iPhone was not triggering the computer at all when I connected it.  I use an iMac. 

  • Hi, I upgrade my Ipad to IOS7 and all my notes on the ipad are gone after the upgrade. There were some very important notes. Is there any way to get them back

    Hi
    After I have upgrade to ios7 - all my note's are gone !!!
    What can I do to get them back ????

    Try this...
    Tap Settings > iCloud
    Switch Notes off then back on.
    Give iCloud a few minutes to re sync the data.

Maybe you are looking for

  • Can I get back my pictures from my broken iphone from securecopying?

    Hello Apple people! So here is my case, I accidentally broke my iphone when I went swimming and now I'm getting a new phone (not apple) so I was woundering that you know when you connect your iphone into your computer it secure copies it right? So no

  • Synchronizing user data from SUS

    Hi, We are on SRM 7.0 and have setup MM-SUS scenario with XI as the interface. We are trying to replicate the users(Contact persons) created by the admin person of a company in SUS into SRM also with 'Bidder' role. For this I have made the following

  • I have disabled cookies in Firefox (v12, latest updates) but whenever I restart FF cookies are enabled again. Is this a bug?

    I have uninstalled any cookie management extensions that were supposed to manage cookies. Any ideas?

  • Long time to sync ipod

    Hi, tearing my hair out with this ipod touch. just tonight whenever I connect my ipod to my pc running XP it starts to synchronise and takes about 3-4 mins. eventually it completes the sync but theres no way it should be taking that long, worked fine

  • Glossary Tab - No Contents

    Weird problem. Using RH 9 and Win 7 64-bit. I build a HtmlHelp output, and if I double-click on the chm within Windows Explorer, the Glossary tab appears, but it's just a gray empty tab. No glossary contents are displayed. However, if I go into RH, r