How to display output with 5min & 10min averages?

Hi I’ve Data Like below in SqlServer Table
DateTimeMin
Field
Value
2014-10-09 11:01:00
some
1
2014-10-09 11:02:00
some
2
2014-10-09 11:03:00
some
3
2014-10-09 11:04:00
some
4
2014-10-09 11:05:00
some
5
2014-10-09 11:06:00
some
6
2014-10-09 11:07:00
some
7
2014-10-09 11:08:00
some
8
2014-10-09 11:09:00
some
9
2014-10-09 11:10:00
some
10
If I Run a query, I need Output like below (5 minute average)
DateTimeMin
Field
Value
2014-10-09 11:05:00
some
3
2014-10-09 11:10:00
some
8
If it’s 10 minute average, I need output like below
DateTimeMin
Field
Value
2014-10-09 11:10:00
some
5.5
at where clause, I've to use  DateTimeMin between
2014-10-09 11:01:00 and 2014-10-09 11:10:00
Please advise, how?

Hi Visakh
at present I'm getting output like below
ID
DateTimeMin
Value
1
2014-10-09 11:05:00
3
2
2014-10-09 11:10:00
8
How to get output like below(I need to add the Field Column)
ID
DateTimeMin
Field
Value
1
2014-10-09 11:05:00
some
3
2
2014-10-09 11:10:00
some
8
I tried several ways, but unable to get it(The Field Data is same from min 1 to 10)

Similar Messages

  • How to display output with 3 levels in ALV

    He experts,
         I have on classical report & it output is with 3 levels, like
               Ex:  material no<Level-1>
                            customer no<Level-2>
                                                date<Level-3>.
             For this i used 2 select staments within select & endselect statmens.
    Now i want to display in ALV. I can't use Hierarchy FM for this bcoz more than 2 levels.
    Plz help on this
    Regards.

    Hi Kumar,
    Thanks for response
      Here i don't need drill down capability....
                   is it possible to diplay <level-1>  <level-2>   <level-3> by using ALV Grid FM. If not alternative solutions
    Regards.

  • How to display output without fieldnames in write statements

    hi,
    can any one tell how to get output with all fields values of a table without writing fieldnames in write statement.
    giv proper code for this task.Thaks in advance.

    hiii
    if you want to write just values then you can use write statement only ..no need to do anything else.simply write as follows
    LOOP AT t_customer INTO fs_customer.
      WRITE:/ fs_customer-customer_no,
              fs_customer-customer_name,
              fs_customer-customer_amount.
    ENDLOOP
    reward if useful
    thx
    twinkal

  • How to display string with XML content in 4.6?

    Hi,
    I`d like to know how to display string with XML content in it for 4.6.
    4.6 has not method parse_string.
    And example like this is not helpful:
      DATA: lo_mxml    TYPE REF TO cl_xml_document.
      CREATE OBJECT lo_mxml.
      CALL METHOD lo_mxml->parse_string
        EXPORTING
          stream = gv_xml_string.
      CALL METHOD lo_mxml->display.
    Thank you.

    Hi,
    May be you can use fm SAP_CONVERT_TO_XML_FORMAT. But it have some issues with memory usage, the program consumed tons of memory during convert.

  • PPR Report ,How to display Label with TOTAl

    Hi,
    How Can i display PPR Report ,How to display Label with TOTAl like
    [http://apex.oracle.com/pls/apex/f?p=267:30:]
    Thanks
    Edited by: 805629 on Jan 6, 2011 3:34 AM

    Hi,
    For PPR Report:
    Select "Yes" in "Enable Partial Page Refresh" item of "Layout and Pagination" region in Report Attributes of that report.
    For display Label with TOTAL:
    Use "Break Formatting" region in Report Attributes of that report.
    Regards,
    Kartik Patel
    http://patelkartik.blogspot.com/
    http://apex.oracle.com/pls/apex/f?p=9904351712:1

  • How to display data with the same text and key in the drop down list?

    Hi All,
    Would like so to seek for you advice on the above mention topic. How to display the data with the same text and key using function module 'VRM_SET_VALUES'. From my testing by writing a program, this function module will only show the text and key if both have different data. Please find the coding as below. Is the normal behaviour of this function module? How to overcome this problem? Thanks in advance.
    REPORT ZTESTING.
    TYPE-POOLS: VRM.
    DATA: NAME  TYPE VRM_ID,
          LIST  TYPE VRM_VALUES,
          VALUE LIKE LINE OF LIST,
          c(20) type c.
    *      c = 'select any'.
    data:begin of itab occurs 0,
          kunnr like kna1-kunnr,
          name1 like kna1-name1,
         end of itab.
    data:begin of jtab occurs 0,
          kunnr like kna1-kunnr,
          land1 like kna1-land1,
         end of jtab.
    PARAMETERS: p_list(20) AS LISTBOX VISIBLE LENGTH 20
                              default 'SELECT'.
    AT SELECTION-SCREEN OUTPUT.
    NAME = 'p_list'.
    VALUE-KEY = 'Name'.     "---> Data for key is the same with text
    VALUE-TEXT = 'Name'.    "--> Data for text is the same with key
    APPEND VALUE TO LIST.
    VALUE-KEY = '2'.
    VALUE-TEXT = 'Country'.
    APPEND VALUE TO LIST.
    CALL FUNCTION 'VRM_SET_VALUES' EXPORTING ID = NAME VALUES = LIST.
    start-of-selection.
    select kunnr name1 up to 20 rows from kna1 into table itab.
    select kunnr land1 up to 20 rows from kna1 into table jtab.
    case p_list.
    when '1'.
    loop at itab.
    write:/ itab-kunnr,itab-name1.
    endloop.
    when '2'.
    loop at jtab.
    write:/ jtab-kunnr,jtab-land1.
    endloop.
    endcase.
    <Added code tags>
    Moderator Message: Please use the "code" tags to format your code snippet.
    Edited by: Suhas Saha on Nov 17, 2011 11:19 AM

    shawnTan wrote:
    Hi All,
    >
    > Would like so to seek for you advice on the above mention topic. How to display the data with the same text and key using function module 'VRM_SET_VALUES'. From my testing by writing a program, this function module will only show the text and key if both have different data. Please find the coding as below. Is the normal behaviour of this function module? How to overcome this problem? Thanks in advance.
    >
    >
    REPORT ZTESTING.
    >
    > TYPE-POOLS: VRM.
    >
    > DATA: NAME  TYPE VRM_ID,
    >       LIST  TYPE VRM_VALUES,
    >       VALUE LIKE LINE OF LIST,
    >       c(20) type c.
    >
    > *      c = 'select any'.
    >
    > data:begin of itab occurs 0,
    >       kunnr like kna1-kunnr,
    >       name1 like kna1-name1,
    >      end of itab.
    >
    > data:begin of jtab occurs 0,
    >       kunnr like kna1-kunnr,
    >       land1 like kna1-land1,
    >      end of jtab.
    >
    > PARAMETERS: p_list(20) AS LISTBOX VISIBLE LENGTH 20
    >                           default 'SELECT'.
    >
    > AT SELECTION-SCREEN OUTPUT.
    >
    > NAME = 'p_list'.
    >
    > VALUE-KEY = 'Name'.     "---> Data for key is the same with text
    > VALUE-TEXT = 'Name'.    "--> Data for text is the same with key
    > APPEND VALUE TO LIST.
    >
    > VALUE-KEY = '2'.
    > VALUE-TEXT = 'Country'.
    > APPEND VALUE TO LIST.
    >
    > CALL FUNCTION 'VRM_SET_VALUES' EXPORTING ID = NAME VALUES = LIST.
    >
    > start-of-selection.
    > select kunnr name1 up to 20 rows from kna1 into table itab.
    > select kunnr land1 up to 20 rows from kna1 into table jtab.
    >
    > case p_list.
    > when '1'.
    > loop at itab.
    > write:/ itab-kunnr,itab-name1.
    > endloop.
    >
    > when '2'.
    > loop at jtab.
    > write:/ jtab-kunnr,jtab-land1.
    > endloop.
    > endcase.
    >
    > <Added code tags>
    >
    > Moderator Message: Please use the "code" tags to format your code snippet.
    >
    > Edited by: Suhas Saha on Nov 17, 2011 11:19 AM
    This surely seems to be a bug to me(if not by design),  did you check for any SAP notes? Perhaps a front end trace can help(Note 407743) !
    -Rajesh.

  • How to display text in addition to average group result

    Hi All,
    This is probably really simple but i need your help.
    What i have done:
    I have 4 questions which each one has 5 radio box options. For each group of questions, i have put a value of 1-5 for the radio boxes.
    What i am trying to do:
    What i want to do is calculate the total for the group results as an average and display some additional text. T
    The averaging for the group results is working, but i dont know how to add the additional text for the 1-5 values returned.
    For example, if the average for all 4 questions turns out to be 3, i want the text box to not only display 3 but state Moderate - 3; or something like 3 - Moderate.
    Any help would be greatly appreciated.
    Thank you,
    Greg

    Like in Excel you need to add some additional code but with JavaScript it is a lot more code. Unless you use a hidden field to hold the computed average, you need to provide all the code to perform the average, that is sum all the fields and divide by the number of fields. Once you have that value you can concatenate the text to the number. Or you could have one text field with the computed average and a second text field with the text. You will also have to deal with the average not always being a whole number. If you change the number of decimal places for your solution, you will see this.
    function GetField(cName) {
    // get object for field with cName;
    // return object or null if not found;
    var oField = this.getField(cName);
    if(oField == null) app.alert("Field named " +cName + " not found.", 0, 0);
    return oField;
    } // end GetField function;
    function Sum(aNames) {
    // get sum of the fields in aNamee array;
    var nSum = 0; // sum of fields;
    var nValue; // value or a single field;
    // process array of field names;
    for(i = 0; i < aNames.length; i++) {
    var nValue = GetField(aNames[i]).valueAsString;
    if(isNaN(nValue) == false) nSum += Number(nValue);
    } // get next field name;
    return nSum;
    } // end Sum function;
    function Average(aNames) {
    // compute average of the values of array of field names;
    var nAverage = "";
    var nSum = Sum(aNames); // get sum of field values;
    if(aNames.length > 0) nAverage = nSum / aNames.length;
    return nAverage;
    } // end Average function;
    // array of field names to average;
    var aFields = new Array("Value.0", "Value.1", "Value.2", "Value.3", "Value.4");
    // compute average using the function and place result in a variable;
    var nAverage = Average(aFields);
    // array of text for value of average;
    var aResult = new Array("Zero average", "Poor", "Better", "Mid point", "Better", "Best");
    // display computed average and text;
    event.value = nAverage + "  " + aResult[Math.floor(nAverage)];

  • How to display output parameters in storedprocedures in front end?

    hi all ,thank you for all the support.
    Now i want your help .Here below i have given the general format of stored procedure we are using in our application . In procedure we are catching the exception and assigning to an output variable P_STATUS .
    If any exception occurs ,How we display this caught exception from front end that means how we display the exception in front end .We are using VB.NET and VS 2005 and Oracle 9i for development.
    CREATE OR REPLACE PROCEDURE SELECTINTERVALS
    P_MINVAL INTEGER,
    P_MAXVAL INTEGER,
    P_INTERVAL     INTEGER,
    P_USERID VARCHAR2,
    P_STATUS OUT VARCHAR2
    AS
    BEGIN
              SELECT STATEMENT or INSERT STATEMENT     
    EXCEPTION
              WHEN OTHERS THEN
              ROLLBACK;
              P_STATUS:=SQLERRM;
    END;
    If anybody knows, please help me
    thanks & regards

    Both methods are wrong. Returning error/exit codes for the reasons I've stated above.
    As for handling the exception... If you want to propagate the exception, then DO NOT CHANGE IT INTO A MEANINGLESS USER EXCEPTION!
    This is useless:
    WHEN OTHERS THEN
    ROLLBACK;
    P_STATUS:=SQLERRM;
    RAISE_APPLICATION_ERROR(-20011, SQLERRM);
    Why it is meaningless? Because the caller now has to parse the error message to determine just what the actual root exception was... as the root exception number has been replaced with a meaningless number.
    This is meaningful and (almost) correct:
    [pre]
    when OTHERS then
    rollback;
    raise; -- re-raise the exception
    PS. It makes better sense to trap the actual exception like no data found, duplicate PK violations, etc... it seldom makes sense to trap all other exceptions and then do something like a rollback.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • How to view materials with selected moving average price

    Dear Gurus,
    How to view materials with moving average price greater than some selected value?  ie..Is there any report which takes moving average price as input?
    Thanks in advance,
    Sastry

    HI
    While checking any table or report u cannot give conditions (more than this value).
    If it mabe the case, down load the data from table MBEW - Field Name VERPR  to excel file. then u apply conditions, like greater than this value.
    U'll get the desired out put.
    Thanks
    Raman

  • How to display rectangles with the following code in a JPanel?

    I am trying to make a bunch of random rectangles appear inside a JPanel on a GUI form. Im not sire how to display the form and panel with random rectangles. I have in my package the MyRectangle class, a blank JForm class called RectGUI and the class for the panel RectGUIPanel. The following code is from my panel and it should create random rectangles okay but how do I display them inside of a Panel on my RectGUI form? Thanks for the assistance.
    //Declare variables
        private int x;
        private int y;
        private int width;
        private int height;
        private Color color;
        Random rand = new Random();
        public class RectanglePanel extends JPanel
            public void displayRectangles()
                // Declare an arraylist of MyRectangles
                ArrayList<MyRectangle> myArray = new ArrayList<MyRectangle>();
                int maxNumber = 300;
               // Declare Frame and Panel
                JFrame frame = new JFrame();
                Container pane = frame.getContentPane();
                RectanglePanel rect = new RectanglePanel();
                // Set Frame attributes
                frame.setSize(700, 500);
                frame.setLocation(100,100);
                frame.setAlwaysOnTop(true);
                frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                frame.setTitle(" Rectangle Program");
                frame.setVisible(true);
                for (int i = 0; i < maxNumber; i++)
                    MyRectangle rec = createRandomRec();
                    myArray.add(rec);
                    rect.repaint();
            public MyRectangle createRandomRec()  
                   x = rand.nextInt();
                   y = rand.nextInt();
                   width = rand.nextInt();
                   height = rand.nextInt();
                   color = new Color(rand.nextInt(256), rand.nextInt(256), rand.nextInt(256));
                   return new MyRectangle(x, y , width, height, color);
        }

    I am trying to make a bunch of random rectangles appear inside a JPanel on a GUI form. Im not sire how to display the form and panel with random rectangles. I have in my package the MyRectangle class, a blank JForm class called RectGUI and the class for the panel RectGUIPanel. The following code is from my panel and it should create random rectangles okay but how do I display them inside of a Panel on my RectGUI form? Thanks for the assistance.
    //Declare variables
        private int x;
        private int y;
        private int width;
        private int height;
        private Color color;
        Random rand = new Random();
        public class RectanglePanel extends JPanel
            public void displayRectangles()
                // Declare an arraylist of MyRectangles
                ArrayList<MyRectangle> myArray = new ArrayList<MyRectangle>();
                int maxNumber = 300;
               // Declare Frame and Panel
                JFrame frame = new JFrame();
                Container pane = frame.getContentPane();
                RectanglePanel rect = new RectanglePanel();
                // Set Frame attributes
                frame.setSize(700, 500);
                frame.setLocation(100,100);
                frame.setAlwaysOnTop(true);
                frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                frame.setTitle(" Rectangle Program");
                frame.setVisible(true);
                for (int i = 0; i < maxNumber; i++)
                    MyRectangle rec = createRandomRec();
                    myArray.add(rec);
                    rect.repaint();
            public MyRectangle createRandomRec()  
                   x = rand.nextInt();
                   y = rand.nextInt();
                   width = rand.nextInt();
                   height = rand.nextInt();
                   color = new Color(rand.nextInt(256), rand.nextInt(256), rand.nextInt(256));
                   return new MyRectangle(x, y , width, height, color);
        }

  • How to display output only sort format in alv

    Hi Experts,
    I have one problem in alv output display. I'm developing alv report for orders raised during the period.I want to display each order wise value(netwr) and order quatity (kwmeng) . i set 8 radio buttons one radio btn click then i want output ex.in grid display click on sort then each order wise calculate the value and quantity . that particular data to display when click on radio button.
    ex:click on sort in grid display.
    (branch) (order no)     (quantity)   (value)                        (BSTNK)
    AMUM     0000003354     2             10                                    3,271
    AMUM     0000003354     1              10                                    6,542
                                                       (above qty sum 2+1=3)  
    (SUM) =   AMUM       0000003354            3                       20            9,813
    HIP2         0000003362     2           5     17,810
    HIP2             0000003362     1          5     23,075
    (sum) = HIP2          0000003362                 10           40,885
    i display output in alv griddisplay.client asking one rb put in selection screen i want output like above only sum col.
    when i click one radio button output is come like (sum) above.
    Please help me.
    Thanks & Regards,
    Balakrishna Gajula

    hi you need to use sortinfo for your requirement.
    ie see the below code.
    "declare sortinfo at data declaration
    data:   wa_sort     type slis_sortinfo_alv,      "''' add this
                layout      type slis_layout_alv.          "add this
    ""make the below changes in your fieldcat
      wa_fieldcat-tabname   = 'FINAL'.
      wa_fieldcat-seltext_m = 'Td - Rvdt'.
      wa_fieldcat-fieldname = 'QUANTITY'.
      wa_fieldcat-do_sum    = 'X'.          """"""add this to your  *QUANTITY field*
      append wa_fieldcat to it_fieldcat.
      clear wa_fieldcat.
      wa_fieldcat-tabname   = 'FINAL'.
      wa_fieldcat-seltext_m = 'temp''.
      wa_fieldcat-fieldname = 'VALUE'.
      wa_fieldcat-do_sum    = 'X'.             """"""add this to your  *VALUE field*
      append wa_fieldcat to it_fieldcat.
      clear wa_fieldcat.
    """"" you need to add this after workarea of fieldcat
      wa_sort-fieldname =  'BRANCH'.  " Here Branch indicates the fieldname
      wa_sort-subtot    = 'X'.
      append wa_sort to it_sort.
      clear wa_sort.
      wa_sort-fieldname = 'ORDERNO'.
      append wa_sort to it_sort.
      clear wa_sort.
    " in your alv fm add sortinfo
      call function 'REUSE_ALV_GRID_DISPLAY'
        exporting
          i_callback_program = sy-cprog
          is_layout          = layout
          it_fieldcat        = it_fieldcat
          it_sort            = it_sort                   """""""""add this
        tables
          t_outtab           = final                   " your internal table name
        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.
    This solves your purpose.
    Regards,
    koolspy.

  • SPOOL - how to display output list of more then 255 characters?

    Hi,
    First of all, I would like to say hi to all of you here, as a new member :)!
    I've just discovered this forum - I'm very new and let's say unexperienced in SAP, unlike you :)!
    Didn't know where to put my subject (in what folder) so I apologize in advance if I'm mistaken... I work as an ABAP programmer in SAP Core and SAP IS-T and currently I'm worried about this problem:(!
    We have these huge reports in IS-T that have to be run in background, because of lot of data. Most of reports are very wide and don't fit in those 255 characters that is SAP standard for spool display. Now I'm dealing with this RFC that has to provide spool display with 800 characters, and this has to be on production by tomorrow:)!!!!!
    First I created new format type (ZX_65_800) in transaction SPAD and assigned it to my local printer. I thought this would be enough, but I was wrong. Because when I try to run my programe in background, the system doesn't offer me my format at all :(!
    Is there anything else I must do in order to get it.... (I work in Release 620)
    If anyone had the same problem, please contact me!
    Thanks,
    BR,
    Sanja

    Hi All,
    We have been looking for a solution for what I believe is the same problem, for more than 2 years now. I would just like to verify with you, if your requirement are similar to ours.
    Problem:
    1.     Requirement is to run large HR reports – either standard or with Ad Hoc Query in background mode in a company with more than 50,000 employees.
    2.     Nobody wants printed reports these days.  We want to save the forests. Customers prefer to be emailed an Excel file so they can do further data analysis, filtering, pivot tables etc.
    3.     Reports are running OK in foreground for smaller sections of the organisation, where you send the output to Excel from ALV, or save as a local file in spreadsheet format.
    4.     But large reports for entire company are awkward, tie up your PCs resources, and complex reports accessing many tables can timeout before completion.
    5.     So scheduling these reports to run in background would be the ideal solution.
    6.     However when we access the report output from SP02, we find that most reports (say with more than 13 or so fields) have an output wider than 255 characters and the output of the spool file wraps to the next line in Excel.  It is very tricky to then parse the data back into one row for each employee.  And you have a problem if you output is for 50,000 or so employees, because then you file is 100,000 rows and will not load completely into Excel – limit problem of 65,536 characters.
    7.     We simply want a spool file that does not wrap the data to the next line after 255 characters.
    8.     But how to explain this simple requirement to some technical people. It seems a lot of posts on SDN think we always want to print a spool file.  NO – remember the forests!
    Possible Solutions:
    I see a lot of posts here that refer to OSS note 186603, but they don’t mention the target for the output of the spool is to import into an Excel File (i.e. spreadsheet format).  Just search for 186603 or ” Spool request with more than 255 columns”.  There is also a reference to OSS note 313566.  I am not sure if these will work?
    I have also seen the suggestions that you need to define a customer printer format that does not wrap the output after 255 characters (create a new format type in transaction SPAD).
    Did you find a solution yet to this problem, do the solutions above work, or can anyone else help us!
    John McKee

  • How to display output serially ?

    hi,
    i have a table and there is a coloum abc, in that data are like that
    PEN
    PENCIL
    BAG
    so now i want a sql query which will display as per my choice serially , like i want pencil should b first then BAG should be second and so on..
    thanks
    Edited by: Hi FRNzzz!! on Apr 22, 2010 10:50 PM

    Hi,
    What are the rules which determine that 'LG08' comes before 'LH07', and 'LH07' comes before 'LH09'?
    It looks like there are no rules, other than "'LG08' comes before 'LH07', and 'LH07' comes before 'LH09'"; that is, the order of those strings has nothing to do with the strings themselves.
    If that's the case, then you should have a table to store information that is related to the different possible m_vr values.
    You may already have such a table, for other uses. If so, add a column for the sort order.
    If you do not already have such a table, create one:
    CREATE TABLE     m_vr_lookup
    (       m_vr          VARCHAR2 (4)     PRIMARY KEY
    ,     sort_order     NUMBER
    );The populate the table with each possible value of m_vr and its relative sort order:
    INSERT INTO m_vr_lookup (m_vr, sort_order) VALUES ('LG08',  100);
    INSERT INTO m_vr_lookup (m_vr, sort_order) VALUES ('LH07',  200);
    INSERT INTO m_vr_lookup (m_vr, sort_order) VALUES ('LH09',  300);
    INSERT INTO m_vr_lookup (m_vr, sort_order) VALUES ('LG01',  400);
    COMMIT;For sort_order, you don't have to use numbers that are multiples of 100. You don't even have to use numbers. I did, because they're convenient. If you add new m_vrf bvalues later, you can give them sort_orders like 150, 125 or 100.003.
    Wheneve you need to use this sort order, join to the m_vr_lookup table, like this:
    SELECT       mvr.*
    FROM            mvr
    LEFT OUTER JOIN       m_vr_lookup     ON     mvr.m_vr     = m_vr_lookup.m_vr
    ORDER BY  mvr.m_sno
    ,            m_vr_lookup.sort_order
    ;Use an outer join (like I did above) if you're not sure that all the m_vr values in mvr are also in m_vr_lookup.
    If you are sure (for example, if you made a foreign key constraint on mvr), and if mvr.m_vr is never NULL, then you can use a more efficient inner join; just change "LEFT OUTER JOIN" to "JOIN" in the query above.
    If you need help, post CREATE TABLE and INSERT statements for your sample data (including the lookup table). Also post the results you want from that data, and an explanation of how you get those results.
    Make sure the results you post correspond to the data you post.
    In your last message, you said the sample data for m_sno=12345 was the following 5 rows:
    12345 LG01 01-JAN-03
    12345 LG02 05-FEB-03
    12345 LG08 03-JUN-07
    12345 LH07 03-FEB-06
    12345 L202 01-FEB-03but the output for that m_sno was 6 rows, including:
    12345 LH09 05-FEB-08Was that a mistake, or is part of the problem generating new rows?

  • How to display output of from clause query?

    Hi. I am using Forms Developer 10g. I have a datablock which uses a from_clause_query. In my from_clause_query, i used a WITH AS SELECT.
    I am trying to display the output of this query in my forms but the first column, V_CUTOFF_TO is not displayed, probably because it is not a database item. It was a result of my initial WITH AS SELECT query months. How can i display this along with the output of my from_clause_query. Thanks in advance for the help. By the way, i am trying to post the contents of my from_clause_query here but it says Sorry, this content is not allowed. I dont know why?

    Here is how you should most your code for it to be legible.
    WITH months AS
      (SELECT ADD_MONTHS(:V_DATE_FROM,LEVEL-1) m_first ,
        (ADD_MONTHS(:V_DATE_FROM, LEVEL    -0 )-1) m_last
      FROM dual
        CONNECT BY LEVEL < MONTHS_BETWEEN(:V_DATE_TO,:V_DATE_FROM) + 1
      EQUIP_per_month AS
      (SELECT COUNT(TRANS_CODE) V_COUNT,
        m_last V_CUTOFF_TO,
        trans_code,
        transformer,
        DATE_COMMISSION,
        DATE_DECOMMISSION,
        CLASSIFICATION,
        SUBSTATION_CODE
      FROM
        (SELECT C.TRANS_CODE,
          C.TRANSFORMER,
          C.SUBSTATION_CODE,
          C.DATE_COMMISSION,
          C.DATE_DECOMMISSION,
          C.CLASSIFICATION,
          m_last
        FROM SPM_TRANS C
        CROSS JOIN months
        WHERE CLASSIFICATION              IS NOT NULL
        AND SUBSTR(C.SUBSTATION_CODE,6,4) <>'M001'
        AND C.DATE_COMMISSION             IS NOT NULL
        AND (C.DATE_PRIVATELY_OWNED       IS NULL
        OR C.DATE_PRIVATELY_OWNED          > m_first)
        AND (SUBSTR(C.TRANS_CODE,5,1) '5'
        AND SUBSTR(C.TRANS_CODE,5,1) '9')
        AND (:P_GRID             = SUBSTR(C.SUBSTATION_CODE, 1,1)
        OR :P_GRID              IS NULL)
        AND (:P_REGION           = SUBSTR(C.SUBSTATION_CODE, 2,4)
        OR :P_REGION            IS NULL)
        AND (C.DATE_DECOMMISSION > m_first
        OR C.DATE_DECOMMISSION  IS NULL)
        AND C.DATE_COMMISSION   <= m_last
        AND (:P_BRANCH           =
          (SELECT DISTINCT BRANCH_CODE
          FROM SPM_SUBSTATIONS
          WHERE C.SUBSTATION_CODE = SUBSTATION_CODE
        OR :P_BRANCH IS NULL)
        AND (:P_ACC   =
          (SELECT DISTINCT ACC_CODE
          FROM SPM_SUBSTATIONS
          WHERE C.SUBSTATION_CODE = SUBSTATION_CODE
        OR :P_ACC                    IS NULL)
        AND (:P_DISTRICT              = SUBSTR(C.SUBSTATION_CODE, 6,4)
        OR :P_DISTRICT               IS NULL)
        AND (RTRIM(:P_CLASSIFICATION) = RTRIM(CLASSIFICATION)
        OR :P_CLASSIFICATION         IS NULL)
        AND (:P_VOLTLEVEL             = SUBSTR(C.TRANS_CODE, 1,1)
        OR :P_VOLTLEVEL              IS NULL)
      GROUP BY m_lAst,
        trans_code,
        transformer,
        DATE_COMMISSION,
        DATE_DECOMMISSION,
        CLASSIFICATION,
        SUBSTATION_CODE
    SELECT V_CUTOFF_TO,
      A.trans_code,
      S.SUBSTATION_CODE,
      A.transformer,
      A.DATE_COMMISSION,
      A.DATE_DECOMMISSION,
      A.CLASSIFICATION
    FROM
      (SELECT *
      FROM
        (SELECT trans_code,
          transformer,
          DATE_COMMISSION,
          DATE_DECOMMISSION,
          CLASSIFICATION,
          SUBSTATION_CODE,
          V_CUTOFF_TO
        FROM EQUIP_per_month
        GROUP BY trans_code,
          transformer,
          DATE_COMMISSION,
          DATE_DECOMMISSION,
          CLASSIFICATION,
          SUBSTATION_CODE,
          V_CUTOFF_TO
      ) A,
      SPM_SUBSTATIONS S
    WHERE A.SUBSTATION_CODE = S.SUBSTATION_CODE
    ORDER BY V_CUTOFF_TO,
      S.SUBSTATION_CODE,
      TRANS_CODE);The V_CUTOFF_TO , your first column, may not to be getting a (not null ) value.
    Regards,
    Edited by: Prabodh on Jun 21, 2012 2:41 PM

  • How to display data with dynamic columns in JavaServerFaces?

    I have a simple JSF application, where I click a button, it will display another page with data table of 2 columns and 3 rows of data. These data are �hard coded� for testing only.
    In the jsp I will use like this:-
    <h:dataTable
    value="#{dataBean.users}"
    var="record">
    <h:column>
    <h:outputText value="#{record.name}"/>
    </h:column>
    <h:column>
    <h:outputText value="#{record.title}"/>
    </h:column>
    </h:dataTable>
    Let�s say, if my data cannot be defined in advance in terms of quantity and names, how should I write my jsp and how should I define in java program?
    For example, instead of the columns �name� and �title� as in above, I will know the column names and the number of columns at run time, how should I do?

    You need a custom component in this case. There afew out there, you may want to check what is out there before you write your own

Maybe you are looking for

  • Need help in linking a pdf file to my website, it stopped working

    I want to upload a pdf file to my web site form my documents and it stop working, its been working fine until Sunday July 28. The support team from my web site said its a firefox issue,because if I use internet explorer it works fine Please help me T

  • Adding Caption to Spry Demo Photo Gallery

    Guys, Can someone please help... I'm trying to add a dynamic caption to the following photo gallery: http://www.stevenbeverage.com/gallery.html Right now, I'm just using the image path for the caption, but it doesn't change with when a new image is l

  • Viewing pictures on TV

    I purchased a camera connector for my ipod. I transfered pictures directly from my camera to my ipod. Is there any way to view the pictures on the TV or do I have to go through itunes which defeats the purpose.

  • Is 4gb RAM enough for os x mavericks?

    I am on a limited budget and thinking of getting a macbook air 13 inch base model and wanted to know if 4gb ram is ok or does it run like crap.

  • External 1080 monitor quit working

    recently, my mid 2007 macbook with OSX 10.6.8 quit properly driving my external monitor at 1920 x 1080. (I use the vga input and the error message on the monitor is invalid format.) It still works at 1024 x 768. the monitor is a Vizio M221NV.  I have