Output formatted number to jTextField

I am new to Java and am building a desk top application. I perform the calculations and get the correct answer in the jTextField; however, I have been unable to get the answers to format. The numbers are "doubles" at this point in the calculations. I have tried several different variations of the code I am posting below and nothing works. All the answers I have found on the web and in books are set up for a System.out.println() answer as opposed to putting the answer in a jTextField. I believe the problem is between the formatting and putting the answer into the jTextField, but am uncertain. I would appreciate any suggestions to alleviate this problem.
Thanks - Bob
if ( M1 > M2) {
NumberFormat numberFormat = NumberFormat.getInstance();
DecimalFormat decimalFormat = (DecimalFormat)numberFormat;
decimalFormat.applyPattern("0.### ### ### ### ### ### ###");
jTextField3.setText(String.valueOf(MDiff));
jTextField4.setText(String.valueOf(EDiff));
else {
NumberFormat numberFormat = NumberFormat.getInstance();
DecimalFormat decimalFormat = (DecimalFormat)numberFormat;
decimalFormat.applyPattern("###,###,###,###,###,###,###");
jTextField3(setText(String.valueOf(MDiff));
jTextField4.setText(String.valueOf(EDiff));
}

The numbers are entered as text, and then converted to a "float" variable. They are then changed to "double" and multiple computations take place. The code that I posted is after the computations of MDiff and EDiff, and covered the "logical if" where I test to see which of two numbers from the initial data entry was larger and format appropriately. There was error in my post which I have corrected. The error was in the 4th line below "else" where it states: "jTextField3(set....." I have changed it to read "jtTextField3.set....", and it builds without error. Sorry about that.
As previously stated, I get correct answers from the computations, but am unable to format the answers.
Bob

Similar Messages

  • Format-number,decimal not giving desired output for PO Print report XSL-FO

    Hi All,
    My requirement was to get the Unit price in european format which is 10.000,00
    Iam getting it as 10000,00 but the client needs the thousand's seperator.
    if have used the decimal seperator but iam getting the Unit Price value as 'NAN' when i submit it for an international language like Italian or Spanish
    This is what i have done
    set the decimal format
    <xsl:decimal-format name="euro" decimal-separator="," grouping-separator="."/>
    <xsl:value-of select="format-number(UNIT_PRICE, '#.###,####', 'euro')"/>
    This gives the desired output when i select the US language.
    While submitting through the conc request
    If i change the Numeric char to '.,' by clickin on Language settings..It works great
    I have tried to use the replace function but the syntax is not correct
    format-number(replace('UNIT_PRICE',',','.'), '#.###.###.###,####', 'euro')
    Any Help would be greatly appreciated.
    Thanks
    Mirza

    Hi Mirza,
    I'm struggling having the same problem. Have you found any solution?
    Best regards
    Kenneth

  • Output Format of Product Number

    Hi,
    This is pertaining to issue with Product Number, I am CIFing numeric product.
    I am trying to CIF 8 digit Product code from ECC to APO and its getting CIFed as 18 digit code in /SAPAPO/MATMAP table in Extnr Material Number field, while displaying MAT1 its showing as only 8 digit.
    I then changed the settings to Field length 18 and activated the lexicographical check in spro in produt master data and also the same setting in OMSL transaction code.
    But when I activate the CIF queue with this setting it gives me an error that Product field length is less.
    I then changed the spro setting and configured the lenghth as 40 and in OMSL its 18, now the product is getting CIFed with leading zeroes and is also displayed with leading zeroes.
    My requirement is that the produt should get CIFed as 8 digit and should also be diaplayed in the table as 8 digit.
    Can someone please tell me what should be the setting in spro and OMSL transaction so that their are no leading zeroes displayed and also in SAP table its not stored with leading zeroes.
    When I create the product directly in APO their are no leading zeroes in table and display.
    Thanks & Regards,
    Sanjog mishrikotkar

    Hi Sanjog,
    The following are the settings where the output format of a
    product number will be maintained
    In R/3, the lexicographic setting will be done in spro>logistics-general>
    material master>basic settings>define output format of material numbers.
    In APO, it is done at spro>APO>Master data>Product>specify output format
    of product numbers.
    Hope this will resolve your issue.
    Please confirm
    Regards
    R. Senthil Mareeswaran.

  • Parsing HEX number from JTextField

    Is there any way that I can parse hex number from JTextField?
    I would like to input 0x1A or similar on JTextField and parse that with
    int parsedInt = Integer.parseInt(JTextField.getText());
    when I type numbers such as 1,2...and etc on the JTextField, the parseInt method works. But if I put 0x2A format, I will get errors.
    Thanks

    Thanks bbritta,
    That is not exactly what I was looking for. The return output from that would be in decimal format. I am just looking to pass on the text including 0x so that I can pass it on to JNI. There, I will use that value with C++. Do you happened to know how to obtain entire text and then converting it to an integer? Thanks again.

  • How to Format number in RTF template?

    Hi,
    In RTF template i am using Format_number for custom requirement. when i am using below conditon <?format-number(ENTERED_CR,'##,##0.00')?> number is getting formatted if above 1000 only. My requirement is 1). 444 should format like 444.00 2). 444.55 should format like 444.55 only. Can anyone suggest on this ASAP.

    in the next time use BI Publisher forum - BI Publisher
    <?format-number(ENTERED_CR,'##,##0.00')?>it's works for me
    output:
    444    ->  444.00
    444.55 ->  444.55

  • How to output money number by text in java?

    How to output money number by text in java?
    Example: input: 1234 $
    output: one thousand two hundred thirty four dollar.

    try this...
    import java.text.DecimalFormat;
    public class EnglishNumberToWords {
      private static final String[] tensNames = {
        " ten",
        " twenty",
        " thirty",
        " forty",
        " fifty",
        " sixty",
        " seventy",
        " eighty",
        " ninety"
      private static final String[] numNames = {
        " one",
        " two",
        " three",
        " four",
        " five",
        " six",
        " seven",
        " eight",
        " nine",
        " ten",
        " eleven",
        " twelve",
        " thirteen",
        " fourteen",
        " fifteen",
        " sixteen",
        " seventeen",
        " eighteen",
        " nineteen"
      private static String convertLessThanOneThousand(int number) {
        String soFar;
        if (number % 100 < 20){
          soFar = numNames[number % 100];
          number /= 100;
        else {
          soFar = numNames[number % 10];
          number /= 10;
          soFar = tensNames[number % 10] + soFar;
          number /= 10;
        if (number == 0) return soFar;
        return numNames[number] + " hundred" + soFar;
      public static String convert(long number) {
        // 0 to 999 999 999 999
        if (number == 0) { return "zero"; }
        String snumber = Long.toString(number);
        // pad with "0"
        String mask = "000000000000";
        DecimalFormat df = new DecimalFormat(mask);
        snumber = df.format(number);
        // XXXnnnnnnnnn
        int billions = Integer.parseInt(snumber.substring(0,3));
        // nnnXXXnnnnnn
        int millions  = Integer.parseInt(snumber.substring(3,6));
        // nnnnnnXXXnnn
        int hundredThousands = Integer.parseInt(snumber.substring(6,9));
        // nnnnnnnnnXXX
        int thousands = Integer.parseInt(snumber.substring(9,12));   
        String tradBillions;
        switch (billions) {
        case 0:
          tradBillions = "";
          break;
        case 1 :
          tradBillions = convertLessThanOneThousand(billions)
          + " billion ";
          break;
        default :
          tradBillions = convertLessThanOneThousand(billions)
          + " billion ";
        String result =  tradBillions;
        String tradMillions;
        switch (millions) {
        case 0:
          tradMillions = "";
          break;
        case 1 :
          tradMillions = convertLessThanOneThousand(millions)
          + " million ";
          break;
        default :
          tradMillions = convertLessThanOneThousand(millions)
          + " million ";
        result =  result + tradMillions;
        String tradHundredThousands;
        switch (hundredThousands) {
        case 0:
          tradHundredThousands = "";
          break;
        case 1 :
          tradHundredThousands = "one thousand ";
          break;
        default :
          tradHundredThousands = convertLessThanOneThousand(hundredThousands)
          + " thousand ";
        result =  result + tradHundredThousands;
        String tradThousand;
        tradThousand = convertLessThanOneThousand(thousands);
        result =  result + tradThousand;
        // remove extra spaces!
        return result.replaceAll("^\\s+", "").replaceAll("\\b\\s{2,}\\b", " ");
       * testing
       * @param args
      public static void main(String[] args) {
        System.out.println("*** " + EnglishNumberToWords.convert(0));
        System.out.println("*** " + EnglishNumberToWords.convert(1));
        System.out.println("*** " + EnglishNumberToWords.convert(16));
        System.out.println("*** " + EnglishNumberToWords.convert(100));
        System.out.println("*** " + EnglishNumberToWords.convert(118));
        System.out.println("*** " + EnglishNumberToWords.convert(200));
        System.out.println("*** " + EnglishNumberToWords.convert(219));
        System.out.println("*** " + EnglishNumberToWords.convert(800));
        System.out.println("*** " + EnglishNumberToWords.convert(801));
        System.out.println("*** " + EnglishNumberToWords.convert(1316));
        System.out.println("*** " + EnglishNumberToWords.convert(1000000));
        System.out.println("*** " + EnglishNumberToWords.convert(2000000));
        System.out.println("*** " + EnglishNumberToWords.convert(3000200));
        System.out.println("*** " + EnglishNumberToWords.convert(700000));
        System.out.println("*** " + EnglishNumberToWords.convert(9000000));
        System.out.println("*** " + EnglishNumberToWords.convert(9001000));
        System.out.println("*** " + EnglishNumberToWords.convert(123456789));
        System.out.println("*** " + EnglishNumberToWords.convert(2147483647));
        System.out.println("*** " + EnglishNumberToWords.convert(3000000010L));
         *** zero
         *** one
         *** sixteen
         *** one hundred
         *** one hundred eighteen
         *** two hundred
         *** two hundred nineteen
         *** eight hundred
         *** eight hundred one
         *** one thousand three hundred sixteen
         *** one million
         *** two millions
         *** three millions two hundred
         *** seven hundred thousand
         *** nine millions
         *** nine millions one thousand
         *** one hundred twenty three millions four hundred
         **      fifty six thousand seven hundred eighty nine
         *** two billion one hundred forty seven millions
         **      four hundred eighty three thousand six hundred forty seven
         *** three billion ten
    }

  • Format Number in XML Publisher

    Hi
    I am developing a RTF template for EXCEL output report. I am trying to format a number value in this report
    <?xdofx:if to_number(QUARTER_QUANTITY) > -1 then QUARTER_QUANTITY end if?>
    in the above line of code how could we format QUARTER_QUANTITY field (i need 9,999, 999 format)
    I have tried both
    format-number:fieldname;’999G999D99’
    format-number(number,format,[decimalformat])
    nothing worked for my.
    Can some one please help me to resolve this issue.
    thanks
    Raj

    Hi Raj,
    Were you able to solve this problem? I am running into the same problem where I want the number to dsiplayed with 2 decimals. When I view the output in Excel format , it cuts off the last zero for eg 18.30 becomes 18.3 If i use any other Output format like HTML trailing 0s are preserved. How do I solve this
    Thanks

  • Format Number Function

    Hello All,
    I am facing a problem in Message Mapping. In the Arithmatic Category we have used the function Format Number. The Number Format  is 0.0
    Decimal Separator is (BLANK)
    In this case If I input any value say 8 or 8.0 then the output should be 8.0. However, I am getting 8,0(COMMA Separator) as the output. This causes the Mapping to Fail.
    This problem occurs on one landscape where as on the other landscape it works fine and gives the output as expected.
    Can anybody help me on that?? Am I missing anything in configuration or are there some special settings for it??
    Kindly help.
    Regards,
    Rohit K

    Hi
    if you put the decimal separator as blank then it will use the . as a decimal separator.
    and when you use the ny other symbol in the decimal separator then it will use that sysmob as decimal separator.
    so please check in ur format number properties what u ahve given.
    Thanks
    Rinku

  • Format-number not working for me with preview to excel

    Hi,
    I have a report with 8 fields across within a table.
    Each field is formatted in the same way, with format-number like this (there are 8):
    <?format-number:total-year-remaining;’PT999G999D99’?>
    (that's the type-your-own form-field help text in the word template).
    When I preview the PDF, the data looks fine (8 cells shown below):
    .00 (.10) (.10) .00 (.50) (.50) (.60) (.60)
    But when previewing to Excel, there are two problems:
    1. Only the data in the last field (the 8th one) is formatted with the oracle mask:
    (.60)
    But upon closer inspection, there are two blank spaces after the number in that cell, and the value itself is treated like a string, e.g. '(.60) '. In fact if I ask excel to format this cell like a number with currency and two decimal places, in won't do it because of trailing spaces. Its just not a number to excel at that point. Probably the ('s don't help things either.
    2. The data in the first seven fields in excel are numeric, and I can format them in excel as currency, but I wanted XMLP to handle this, not the excel user.
    The bottom line is this: I want both PDF and excel output. I want both forms to have the fomat mask applied correctly. And I want excel to treat each cell as a number. Is this possible?
    Thanks
    Adam

    Anatoli,
    Hello!
    I don't know if my situation is the same as yours, but after a lot of head-scratching, forum searching and template rebuilding, I finally figured out my problem.
    I had one column that no matter what I did kept appearing in Excel as text. I'd format it to Number in Excel and nothing. When trying to sum the column, Excel would not recognize any of the values as numbers. I even did the reformatting on the XML Word template to number, and the currency format that Adam mentions. Still no go. The $ and ',' appeared, but column still formatted as string.
    I just finally noticed Adam's mention of the 2 extra spaces at the end of the numbers and sure enough mine was doing the same thing. Take out the 2 spaces and voila! Number!
    Every time I redid my template in Word (07 and 03), I used the wizard. (Add-ins>Insert>Table>Wizard) walked through the steps, not really changing anything. Then I would preview and the spaces would be there. The column that I was having problems with was the last column of the table, which would get the text 'end G_ASSIGNED_CC' inserted in after the field name - separated by 2 spaces. Once I took out these two spaces, so the column now shows 'COSTend G_ASSIGNED_CC', it worked fine in Excel - all numbers.
    Hope that helps someone out there as I was having a heck of a time finding anything (solutions anyway) on this.
    Thanks,
    Janel

  • How to get this output format in ALV report

    Hi.
    Can any one pls let me know how to get the following output format in ALV report.Following are the outputfields
    companycode   location     position     approver
    300    800       01    watson
    null   null        03     candy
    null   null        04     smith
    null   null        05     michael
    one empty line after this again
    300     800     01     ryant
    null      null    02     gyan
    null      null    03     fermi
    null      null    04     ogata
    *Note: Null     indicates  empty space .( i.e I need to get empty space in  output where ever null is there.)
            Thanks in advance.
    Kind Regards,
    samiulla.

    hi,
    u can use 'REUSE_ALV_LIST_DISPLAY'
                           or
    'REUSE_ALV_GRID_DISPLAY'  function modules.
    SAMPLE CODE :
    *& Report  Y101982CHD
    *                         TABLES
    TABLES: vbak.    " standard table
    *                           Type Pools                                 *
    TYPE-POOLS: slis.
    *                     Global Structure Definitions                     *
    *-- Structure to hold data from table CE1MCK2
    TYPES: BEGIN OF tp_itab1,
           vbeln LIKE vbap-vbeln,
           posnr LIKE vbap-posnr,
           werks LIKE vbap-werks,
           lgort LIKE vbap-lgort,
           END OF tp_itab1.
    *-- Data Declaration
    DATA: t_itab1 TYPE TABLE OF tp_itab1.
    DATA : i_fieldcat TYPE slis_t_fieldcat_alv.
    *                    Selection  Screen                                 *
    *--Sales document-block
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-t01.
    SELECT-OPTIONS: s_vbeln FOR vbak-vbeln.
    SELECTION-SCREEN END OF  BLOCK b1.
    *--Display option - block
    SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-t02.
    PARAMETERS: alv_list RADIOBUTTON GROUP g1,
                alv_grid RADIOBUTTON GROUP g1.
    SELECTION-SCREEN END OF  BLOCK b2.
    *file download - block
    SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-t03.
    PARAMETERS: topc AS CHECKBOX,
                p_file TYPE rlgrap-filename.
    SELECTION-SCREEN END OF  BLOCK b3.
    *                      Initialization.                                *
    *                      At Selection Screen                            *
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
      CALL FUNCTION 'F4_DXFILENAME_4_DYNP'
        EXPORTING
          dynpfield_filename = 'P_FILE'
          dyname             = sy-cprog
          dynumb             = sy-dynnr
          filetype           = 'P'      "P-->Physical
          location           = 'P'     "P Presentation Srever
          server             = space.
    AT SELECTION-SCREEN ON s_vbeln.
      PERFORM vbeln_validate.
    *                           Start Of Selection                         *
    START-OF-SELECTION.
    *-- Fetching all the required data into the internal table
      PERFORM select_data.
    *                           End Of Selection                           *
    END-OF-SELECTION.
      IF t_itab1[] IS NOT INITIAL.
        IF topc IS NOT INITIAL.
          PERFORM download.
          MESSAGE 'Data Download Completed' TYPE 'S'.
        ENDIF.
        PERFORM display.
      ELSE.
        MESSAGE 'No Records Found' TYPE 'I'.
      ENDIF.
    *                           Top Of Page Event                          *
    TOP-OF-PAGE.
    *& Form           :      select_data
    * Description     : Fetching all the data into the internal tables
    *  parameters    :  none
    FORM select_data .
      SELECT vbeln
         posnr
         werks
         lgort
         INTO CORRESPONDING  FIELDS OF TABLE t_itab1
         FROM vbap
         WHERE  vbeln IN s_vbeln.
      IF sy-subrc <> 0.
        MESSAGE 'Enter The Valid Sales Document Number'(t04) TYPE 'I'.
        EXIT.
      ENDIF.
    ENDFORM.                    " select_data
    *& Form        : display
    *  decription  : to display data in given format
    * parameters   :  none
    FORM display .
      IF alv_list = 'X'.
        PERFORM build_fieldcat TABLES i_fieldcat[]
                               USING :
    *-Output-field Table      Len  Ref fld Ref tab Heading    Col_pos
       'VBELN'       'T_ITAB1'     10   'VBAP'  'VBELN'    ''            1,
       'POSNR'       'T_ITAB1'     6    'VBAP'  'POSNR'    ''            2,
       'WERKS'       'T_ITAB1'     4    'VBAP'  'WERKS'    ''            3,
       'LGORT'       'T_ITAB1'     4    'VBAP'  'LGORT'    ''            4.
        *CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'*
          *EXPORTING*
            *i_callback_program       = sy-repid*
    **        i_callback_pf_status_set = c_pf_status*
            *i_callback_user_command  = 'USER_COMMAND '*
    **        it_events                = t_alv_events[]*
            *it_fieldcat              = i_fieldcat[]*
          *TABLES*
            *t_outtab                 = t_itab1[]*
          *EXCEPTIONS*
            *program_error            = 1*
            *OTHERS                   = 2.*
        *IF sy-subrc <> 0.*
    ** MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO*
    **         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.*
        *ENDIF.*
      ENDIF.
      IF alv_grid = 'X'.
        PERFORM build_fieldcat TABLES i_fieldcat[]
                                 USING :
    *-Output-field Table      Len  Ref fld Ref tab Heading    Col_pos
         'VBELN'       'T_ITAB1'     10   'VBAP'  'VBELN'    ''            1,
         'POSNR'       'T_ITAB1'     6    'VBAP'  'POSNR'    ''            2,
         'WERKS'       'T_ITAB1'     4    'VBAP'  'WERKS'    ''            3,
         'LGORT'       'T_ITAB1'     4    'VBAP'  'LGORT'    ''            4.
        *CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'*
          *EXPORTING*
            *i_callback_program       = sy-repid*
    **        i_callback_pf_status_set = c_pf_status*
            *i_callback_user_command  = 'USER_COMMAND '*
            *it_fieldcat              = i_fieldcat*
          *TABLES*
            *t_outtab                 = t_itab1[]*
        *EXCEPTIONS*
       *program_error                     = 1*
       *OTHERS                            = 2.*
        *IF sy-subrc <> 0.*
    ** MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO*
    **         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.*
        *ENDIF.*
      *ENDIF.*
    ENDFORM.                    " display
    *& Form        : vbeln_validate
    *  description : to validate sales document number
    * parameters   :  none
    FORM vbeln_validate .
      DATA: l_vbeln TYPE vbak-vbeln.
      SELECT SINGLE vbeln
        FROM vbak
        INTO l_vbeln
        WHERE vbeln IN s_vbeln.
      IF sy-subrc NE 0.
        MESSAGE 'ENTER THE VALID SALES DOCUMENT NO:' TYPE 'I'.
        EXIT.
      ENDIF.
    ENDFORM.                    " vbeln_validate
    *& Form       :build_fieldcat
    * Description : This routine fills field-catalogue
    *  Prameters  : none
    FORM build_fieldcat TABLES  fpt_fieldcat TYPE slis_t_fieldcat_alv
                        USING   fp_field     TYPE slis_fieldname
                                fp_table     TYPE slis_tabname
                                fp_length    TYPE dd03p-outputlen
                                fp_ref_tab   TYPE dd03p-tabname
                                fp_ref_fld   TYPE dd03p-fieldname
                                fp_seltext   TYPE dd03p-scrtext_l
                                fp_col_pos   TYPE sy-cucol.
    *-- Local data declaration
      DATA:   wl_fieldcat TYPE slis_fieldcat_alv.
    *-- Clear WorkArea
      wl_fieldcat-fieldname       = fp_field.
      wl_fieldcat-tabname         = fp_table.
      wl_fieldcat-outputlen       = fp_length.
      wl_fieldcat-ref_tabname     = fp_ref_tab.
      wl_fieldcat-ref_fieldname   = fp_ref_fld.
      wl_fieldcat-seltext_l       = fp_seltext.
      wl_fieldcat-col_pos         = fp_col_pos.
    *-- Update Field Catalog Table
      APPEND wl_fieldcat  TO  fpt_fieldcat.
    ENDFORM.                    "build_fieldcat
    *& Form        : download
    *  description : To Download The Data
    *  Parameters  :  none
    FORM download .
      DATA: l_file TYPE string.
      l_file = p_file.
      CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
          filename                = l_file
          filetype                = 'ASC'
        TABLES
          data_tab                = t_itab1
        EXCEPTIONS
          file_write_error        = 1
          no_batch                = 2
          gui_refuse_filetransfer = 3
          invalid_type            = 4
          no_authority            = 5
          unknown_error           = 6.
      IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDFORM.                    " download
    HOPE IT WILL HELP YOU
    REGARDS
    RAHUL SHARMA

  • Query Output Formatting Help

    Hello All,
    I'm having problems trying to format the output of one of my queries. I'm new to SQL and I consider my writing the query a HUGE win.... but I can't seem to get the correct output format.
    Per the code below, it is outputting the Last Name (lname) of the employee, a count of what I want, and the overall rank.  I would like to concatenate the employee number (emp#) the first (fname) and last name (lname) together into the same column in the output.
    The concatenation code would be something like the below.
    Desired concatenation:
    emp# || ' - ' || lname || ', ' || fname AS EMPLOYEE
    I'm using Oracle 11g Express. Please let me know if you need any supporting information to assist you.
    I appreciate all your help!!! Thank you.
    Query
    SELECT EMPLOYEE, PREPARED,
    RANK() OVER (ORDER BY Prepared DESC) AS rank
    FROM (SELECT lname EMPLOYEE , COUNT(DISTINCT reportnum) PREPARED
          FROM employee
          LEFT OUTER JOIN faultreport USING (empno)
          GROUP BY lname
          ORDER BY Prepared DESC)
    WHERE rownum < 15;

    Hi,
    8bb7968b-e6ae-456c-8459-f418352e9e0a wrote:
    Hello All,
    I'm having problems trying to format the output of one of my queries. I'm new to SQL and I consider my writing the query a HUGE win.... but I can't seem to get the correct output format.
    Per the code below, it is outputting the Last Name (lname) of the employee, a count of what I want, and the overall rank.  I would like to concatenate the employee number (emp#) the first (fname) and last name (lname) together into the same column in the output.
    The concatenation code would be something like the below.
    Desired concatenation:
    emp# || ' - ' || lname || ', ' || fname AS EMPLOYEE
    I'm using Oracle 11g Express. Please let me know if you need any supporting information to assist you.
    Whenever you have a problem, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all the tables involved, and the results you want from that data.
    Explain, using specific examples, how you get those results from that data.
    Always say what version of Oracle you're using (e.g. 11.2.0.2.0).
    See the forum FAQ: https://forums.oracle.com/message/9362002
    I appreciate all your help!!! Thank you.
    Query
    SELECT EMPLOYEE, PREPARED,
    RANK() OVER (ORDER BY Prepared DESC) AS rank
    FROM (SELECT lname EMPLOYEE , COUNT(DISTINCT reportnum) PREPARED
          FROM employee
          LEFT OUTER JOIN faultreport USING (empno)
          GROUP BY lname
          ORDER BY Prepared DESC)
    WHERE rownum < 15;
    It looks like you've found the right way to concatenate the columns.  How to use that in your query depends on your data, and what you want the query to do with that data.
    If you GROUP BY lname, what do you want the concatenated value to be when different rows having the same lname have different fnames and/or emp#s?
    Do you want to GROUP BY the new concatenated employee instead of lname?

  • ALV output FORMAT

    HI
    I WANT OUTPUT FORMAT IN THIS WAY
    number         1___nar _  __1__REV____1________________1______________1
                        1   S  1   Q   1     S  1  Q  1              1            1        1               1
    Suggest me how to write this

    <b>is your problem solved????</b>
    u marked as solved..
    its ok kkk

  • Help : Complex Output Format

    Hi there
    Using Data in TAB_DTL for an APPID, I need to generate a Report in the following format.
    CREATE TABLE TAB_DTL
    APPDATE          DATE,
    AMOUNT          NUMBER(12,2),
    STATUS          VARCHAR2(1),
    RATE          NUMBER(5,2)
    INSERT INTO TAB_DTL ( APPDATE, AMOUNT, STATUS, RATE ) VALUES TO_DATE( '13/09/2011 10:50:45 AM','DD/MM/YYYY HH:MI:SS AM'), 500000, 'D', 13 );
    INSERT INTO TAB_DTL ( APPDATE, AMOUNT, STATUS, RATE ) VALUES TO_DATE( '09/11/2011 1:15:30 PM','DD/MM/YYYY HH:MI:SS AM'), 5000, 'R', 13 );
    INSERT INTO TAB_DTL ( APPDATE, AMOUNT, STATUS, RATE ) VALUES TO_DATE( '15/12/2011 3:20:31 PM','DD/MM/YYYY HH:MI:SS AM'), 5000, 'R', 13 );
    INSERT INTO TAB_DTL ( APPDATE, AMOUNT, STATUS, RATE ) VALUES TO_DATE( '05/01/2012 10:25:11 AM','DD/MM/YYYY HH:MI:SS AM'), 5000, 'R', 13 );
    INSERT INTO TAB_DTL ( APPDATE, AMOUNT, STATUS, RATE ) VALUES TO_DATE( '02/02/2012 4:23:34 PM','DD/MM/YYYY HH:MI:SS AM'), 5000, 'R', 13 );
    INSERT INTO TAB_DTL ( APPDATE, AMOUNT, STATUS, RATE ) VALUES TO_DATE( '05/03/2012 11:15:45 AM','DD/MM/YYYY HH:MI:SS AM'), 5000, 'R', 13 );
    INSERT INTO TAB_DTL ( APPDATE, AMOUNT, STATUS, RATE ) VALUES TO_DATE( '30/03/2012 11:55:10 AM','DD/MM/YYYY HH:MI:SS AM'), 5000, 'R', 13 );
    INSERT INTO TAB_DTL ( APPDATE, AMOUNT, STATUS, RATE ) VALUES TO_DATE( '31/03/2012 11:59:00 AM','DD/MM/YYYY HH:MI:SS AM'), 470000, 'B', 13 );
    OUTPUT FORMAT :
    APPDATE                    DR          CR     BALANCE          ACCAMT     DAYS     CUMM     
    13/09/2011 10:50:45 AM          5,00,000.00     0     5,00,000.00     10301     58     10301
    09/11/2011 1:15:30 PM          0          5000     4,95,000.00     6330     36     16631
    15/12/2011 3:20:31 PM          0          5000     4,90,000.00     3655     21     20286
    05/01/2012 10:25:11 AM           0          5000     4,85,000.00     4823     28     25109
    02/02/2012 4:23:34 PM          0          5000     4,80,000.00     5456     32     30565
    05/03/2012 11:15:45 AM          0          5000     4,75,000.00     4218     25     34783
    30/03/2012 11:55:10 AM          0          5000     4,70,000.00     334     2     35117
    31/03/2012 11:59:00 AM          0          0     4,70,000.00     35117Logic for computation of A) DAYS : Difference in Days from the next succeeding Date
                   B) ACCAMT : Balance * (Difference in Days from the next Date) * Rate / Days in the Financial Year
    Using CASE / LEAD SQLs, can the same be accomplished.
    Thanks

    # If appdate is 31-MAR-YYYY and time portion is > 11:59:AM THEN we will treat it as 01-APR-2012 otherwise the we will ignore the timestamp of appdate
    SELECT TO_CHAR (tab_dtl_vw.appdate, 'DD/MM/YY fmHHfm:MI:SS AM') appdate,
           CASE
               WHEN round(tab_dtl_vw.dr,2) < 10000 THEN to_char(round(tab_dtl_vw.dr,2))
               ELSE TO_CHAR(round(tab_dtl_vw.dr,2),'FM99,99,99,99,99,99,99,999.00')
           END dr,
           CASE
               WHEN round(tab_dtl_vw.cr,2) <10000 THEN to_char(round(tab_dtl_vw.cr,2))
               ELSE TO_CHAR(round(tab_dtl_vw.cr,2),'FM99,99,99,99,99,99,99,999.00')
           END cr,
           CASE
               WHEN round(tab_dtl_vw.balance,2) <10000 THEN to_char(round(tab_dtl_vw.balance,2))
               ELSE TO_CHAR(round(tab_dtl_vw.balance,2),'FM99,99,99,99,99,99,99,999.00')
           END balance,
           tab_dtl_vw.days,
           CASE
               WHEN tab_dtl_vw.days IS NOT NULL THEN ROUND ((tab_dtl_vw.balance * tab_dtl_vw.days * tab_dtl_vw.rate) / (tab_dtl_vw.daysinyear*100))
               ELSE SUM(ROUND((tab_dtl_vw.balance * tab_dtl_vw.days * tab_dtl_vw.rate) / (tab_dtl_vw.daysinyear*100)))
                       OVER(ORDER BY tab_dtl_vw.appdate)
           END accamt,
           CASE
               WHEN tab_dtl_vw.days IS NOT NULL THEN SUM(ROUND((tab_dtl_vw.balance * tab_dtl_vw.days * tab_dtl_vw.rate) / (tab_dtl_vw.daysinyear*100)))
               OVER(ORDER BY tab_dtl_vw.appdate)
               ELSE NULL
           END cummamt
    FROM
      ( SELECT appdate ,
                   CASE  WHEN status = 'D' THEN amount   ELSE 0  END AS dr ,
                   CASE   WHEN status = 'R' THEN amount  ELSE 0  END AS Cr ,
                   SUM (amount * CASE WHEN status = 'D' THEN 1 WHEN status = 'R' THEN -1 END) OVER (ORDER BY appdate) AS balance ,
                   CEIL (LEAD(appdate) OVER (ORDER BY appdate) - appdate ) AS days ,
                   rate ,
                   CASE 
                       WHEN (appdate >= '01-APR-' || TO_CHAR(appdate,'YYYY')  AND
                       TO_CHAR(LAST_DAY('01-FEB-' || (TO_CHAR(appdate,'YYYY') + 1)),'DD-MON') = '29-FEB')
                              THEN 366
                        WHEN TO_CHAR(LAST_DAY('01-FEB-' || TO_CHAR(appdate,'YYYY')),'DD-MON') = '29-FEB'
                               THEN 366
                        ELSE 365
                    END daysinyear
           FROM (SELECT CASE WHEN (TO_CHAR(TRUNC(APPDATE),'DD-MON') = '31-MAR' AND APPDATE > TRUNC(APPDATE - 1/2 - 60/86400)) THEN TRUNC(APPDATE) +1 ELSE TRUNC(APPDATE) END appdate,
                        status,
                        amount,
                        rate
                  FROM  tab_dtl
         ) tab_dtl_vw
    ORDER BY tab_dtl_vw.appdate ASC
    Output
    APPDATE              DR         CR         BALANCE                                        DAYS     ACCAMT    CUMMAMT
    13/09/11 12:00:00 AM 5,00,000.0 0          5,00,000.00                                      57      10123      10123
    09/11/11 12:00:00 AM 0          5000       4,95,000.00                                      36       6330      16453
    15/12/11 12:00:00 AM 0          5000       4,90,000.00                                      21       3655      20108
    05/01/12 12:00:00 AM 0          5000       4,85,000.00                                      28       4823      24931
    02/02/12 12:00:00 AM 0          5000       4,80,000.00                                      32       5456      30387
    05/03/12 12:00:00 AM 0          5000       4,75,000.00                                      25       4218      34605
    30/03/12 12:00:00 AM 0          5000       4,70,000.00                                       2        334      34939
    01/04/12 12:00:00 AM 0          0          4,70,000.00                                              34939
    {code}
    Edited by: Himanshu Binjola on Apr 24, 2012 11:18 AM
    Edited by: Himanshu Binjola on Apr 24, 2012 11:20 AM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Error When creating Broadcastings "Portal theme does not fit output format"

    Hi All,
    When i create a Broadcasting Settings i am getting an Error saying "Portal theme does not fit output format", and below is the detailed that we are getting,
    "Diagnosis
    You used separate portal themes to generate PDF or print formats (PS or PCL). The output format that you selected is not appropriate for the portal theme currently set.
    System Response
    The broadcast setting is not consistent and you cannot save or execute it.
    Procedure
    Change the output format or the portal theme correspondingly. (The portal theme is set to the first valid value for the current output format when you display the corresponding tab page).
    Procedure for System Administration
      Notification Number RSRD 640"
    Can anyone help how to resolve this issue?
    Regards,
    Muruganand.K

    Would you have chance to provide me the sollution...
    We are facing the exactly the same error message
    Thanks a lot in advance
    Regards
    Ivan

  • Anyone understand the purpose of Proxy render/output format?

    So I've done a couple of projects with X now and am fairly happy with the proxy workflow:
    1) Ingest, creating proxies, but no optimized - render format set to ProRes regular
    2) Edit in proxy
    3) In preferences, switch back to "Use original or optimized"
    4) Tweak edit
    5) Render and export
    However, I'm still not understanding the thinking behind the render/output format (full-resolution proxy) when you are editing in proxy. It seems to me that it SHOULD be:
    EITHER: When you're editing proxy, if you render/export, FCPX renders/outputs in proxy using the same low resolution as your proxy files. This would be great for early, quick samples for clients. No need to spend forever rendering full-res ProRes regular, or the pointless upsizing of pre-rendered lo-res proxies.
    OR: Even while you're editing from proxies, background rendering is done in your full-quality format (i.e. 1080 ProRes regular). This would save you from re-rendering when you switch back over to original/optimized.
    Ideally, there'd be a toggle to choose which of these you want. Even without a toggle, Apple should pick one of these it seems. The way it is now seems useless.
    SUMMARY:
    While editing in proxy, render/output should be either:
    1) 720x540 ProRes Proxy
    OR
    2) 1920x1080 ProRes Regular
    BUT NOT
    3)1920x1080 ProRes Proxy
    I was going to send an enhancement request about it, but figured I'd first see if anybody knows of a useful reason for it instead being this third, awkward format.
    Thoughts?

    I had hoped the summary would clear up the question. I guess not. Let's try this again:
    QUESTION - Would other people like the output, when in proxy mode, to be a low-res ProRes Proxy file - the same size as the files that are created when you tell FCPX to make proxies of your original files?
    DETAILS
    - When you create proxies of your original files, they are a low-resolution of "something"x540 (in my case 720x540)
    - If you output while in proxy, you get a proxy output file at 1920x1080 - this is 5.3 times as many pixels to render as 720x540.
    - Assuming a linear relationship between number of pixels and render time, this means it would take over 5 times as long to render the current form of proxy output, as compared to what I'm asking for.
    - I want a quickly-rendered format (like 720x540 Proxy) so I can quickly render/output, change things, re-render/output, sending multiple sample files to the client.
    - Of course, the ability to mark in/out on the timeline and export just that section is also important here, but that's another post and has already been discussed.
    - For further details, see my original post
    As for my workflow, I don't need to work with either/or. I work in proxy (which, if you're doing more than straight cuts, allows better playback before rendering, no matter what computer you're using) until I'm ready for the final tweaks to graphics or the edit that actually rely on fine detail, and want to output in 1080 Prores regular, at which point I change the preference back to original/optimized, like I said right at the start of the first post. No mind reading necessary. I then tweak, render and output. I'm not sure you're understanding the purpose of a proxy workflow.

Maybe you are looking for

  • Windows 8 does not recognise photosmart 5510

    Cannot use my HP Photosmart since installing Windows 8. Printer does not recognise my pc. This question was solved. View Solution.

  • Powermac G4 ADC Display Problem

    Hi, I just bought a 17" Studio (LCD Flat Panel) Display. I was suprised to see that everything is powered by one cable because I though that I needed separate cables. I installed an AGP Graphics Card from another Powermac G4 MDD. The Powermac G4 I in

  • Register PL/SQL functions

    Hi, I want to use the EXTRACT function in Discoverer. I went through the Help for the «Import PL/SQL function» without success.... When I click the «Import» button, I see a HUGE list of functions, and I don't recognize which is the one I want. I use

  • Replace '0.00' with Blank

    Hi, In my Smartform Output requirment If amount is Initial I need to Show a Blank . My variable is XVAR(6) Type P decimals 2. How do we do  that? Regards Vara

  • How to enable printer range selection in printer Dialog?

    I try to do the printer setup, when I do Code: job.setPageable (book); if (job.printDialog ()) { try { job.print (); catch (PrinterException ex) { ex.printStackTrace (); note: job is PrinterJob. The printer setup that shown, it disable the selection