Need SQVI or db02 query for summing

I have a DSO that has a date field in it, i.e. 11/21/2010 and I need I need to know how many records I have for each year.
For example, if I have 100 records in the table I'm hoping to get an output like:
2008 20
2009 35
2010 40
2011  5
so I have access to sqvi or the db02 sql exe.
The table name of the dso is like /BIC/AZCO_O008 and the field is 0calday.
Any ideas, I'not really familiar with sqvi?
Mike

Closing action. I can use RSDU_EXEC_QRY.

Similar Messages

  • Need to write a query for extractions

    How can I extract the following data from Oracle:
    1. Segment1 and description from mtl_system_items_b
    2. Onhand quantity that is orderable (Not under the WIP manufacturing or PO)
    3. Onhand quantity that not orderable (That is under WIP manufacturing or PO)
    4. Retail Price of these items.
    There is only one organization_id =21 needs to be considered. This extract needs to be a daily kind of an extract. If you can help me in writing the query for all the fields above with proper joins, I'll really appreciate.
    Thanks & Regards
    KM

    Hi,
    Primary_uom_code and Primary_transaction_quantity shows the items quantity on the basis of primary code
    whereas Secondary_uom_code and secondary_transction_quantity shows the items quantity on different code.
    e.g. suppose you have an item Pen opened on the primary code as Each. 1 Each = 1 Pen.
    You have a conversion set as 10 Each = 1 Pkt.
    At the time of transaction if you selects as 1 Pkt,
    The primary_transaction_quantity will show 10 Each where as the secondary_transaction_quantity will show 1Pkt.
    Now as the transaction has done as Pkt the column Transaction_quantity will display 10Pkt.
    If you have done this transaction on the primary code as 10 Each.
    The primary_transaction_quantity would show the same 10 Each but the Secondary_transaction_quantity will by
    null and the transaction_quantity will be 10 Each.
    Hope this will clarify the issue.
    2) why you want to join these tables
    How can I join the following tables: qp_list_lines and mtl_system_items_b? I want to find the price of each
    item. I tried using inventory_item_id but it does not work as inventory_item_id can be null in qp_list_lines table.i have not been able to find any thing in table qp_list_lines.

  • Need helping in writing query for finding percentage of duration

    Can any one please help in writing query for this.
    The table is like this :-
    ID     Region     Month     Duration
    I1 R1     Jan     80
    I2     R2     Jan     70
    I3     R1     Jan     70
    I4     R3     Jan     40
    I5     R1     Feb     80
    I6     R2     Feb     30
    I7     R3     Mar     100
    I want to write a query to find
    % of duration for each and every region against each and every month.
    Please help in solving this query. I am in urgent need of this.
    Thanks in advance.

    I also have to do in MS Access 2003You also have to ask into an other forum since here it's an Oracle forum, to try to find Oracle solution.
    Nicolas.

  • Need help writing a query for following scenario

    Hi all, I need some help writing a query for the following case:
    One Table : My_Table
    Row Count: App 5000
    Columns of Interest: AA and BB
    Scenario: AA contains some names of which BB contains the corresponding ID. Some
    names are appearing more than once with different IDs. For example,
    AA BB
    Dummy 10
    Me 20
    Me 30
    Me 40
    You 70
    Me 50
    Output needed: I need to write a query that will display only all the repeating names with their corresponding IDs excluding all other records.
    I would appreciate any input. Thanks

    Is it possible to have a records with the same values for AA and BB? Are you interested in these rows or do you only care about rows with the same value of AA and different BB?
    With a slight modification of a previous posting you can only select those rows that have distinct values of BB for the same value of AA
    WITH t AS (
    SELECT 'me' aa, 10 bb FROM dual
    UNION ALL
    SELECT 'me' aa, 20 bb FROM dual
    UNION ALL
    SELECT 'you' aa, 30 bb FROM dual
    UNION ALL
    SELECT 'you' aa, 30 bb FROM dual
    SELECT DISTINCT aa, bb
      FROM (SELECT aa, bb, COUNT(DISTINCT bb) OVER(PARTITION BY aa) cnt FROM t)
    WHERE cnt > 1;

  • Need to write SQL query for hierarchy

    Hi Guys,
    I need help to write a query for the below scenario.
    I have one organization, under that I have many branches. when i provide input to query on last branch, i need to display all parents of that branch like below
    Organization   ---parent
      branch 1  ---child
         branch11
         branch 12
        branch 2   ---child
          branch 21
         branch 3 ----child
          branch 31
          branch 32
          branch 33
    here, when i provide input as branch 3, then I need to fetch results branch 2, branch 1 till organization.
    can any one help me on this.
    Thanks in advance!
    Regards,
    LKR

    Hi,
    Is this the same question as
    https://community.oracle.com/thread/2616828
    Please don't post the same question over and over.  Mark this thread as "Answered" right away, and continue in the other thread (if necessary; the other thread has answers.)

  • Need to find SAP query for corresponding ABAP program.

    Hello SAP Experts,
    I have an ABAP program "AQDESYSTQV000001ORDERDETAILS==" in ECC 4.7. We had a client copy recently from ECC 4.7 to ECC 6.0. Now in ECC 6.0 I am unable to find this program in SE38.
    Can you please tell me how to create this program in ECC 6.0 ? Also, by the name of this program it is clearly seen that this program is automatically created by using SAP query.
    I tried to generate the program using SQ01, but system asks me for the SAP query.
    Can you please tell me how to find the SAP Query for the corresponding abap program ? Also, the steps as in how to generate the program in ECC 6.0.
    Thanks.

    Hi Danish,
    In the program name, the query name is always attached.
    For example : The program name is , AQ10SD==========Z10SD_INVPRODL=
                           Here the query name is Z10SD_INVPRODL and if you go to transaction SQ01 and enter the query name
    then you can find the infoset.
    And also you can gernate the program with the help of query name.
    Please try the same and let me know if any details are required.
    Regards,
    Darshana

  • Need help with named query for 1-to-many entities

    Hi all,
    I'm in desperate need of a query and I can't seem to figure it out.
    Here's the situation:
    I have 2 entities in a one-to-many relationship. One ServerInstance to Many AppUrl's related by a join table
    @Entity
    public class ServerInstance implements Serializable {
    @Id
    @GeneratedValue(strategy = GenerationType.SEQUENCE)
    private Integer id;
    private String instancename;
    private String description;
    private String home;
    private String hostname;
    private String hostname_front;
    private String ipfront;
    private String ipback;
    private String os;
    private String layer;
    @OneToMany (fetch = FetchType.EAGER, cascade = {CascadeType.ALL})
    private List<AppUrl> appUrl = new ArrayList<AppUrl>();
    @Entity
    public class AppUrl implements Serializable {
    @Id
    @GeneratedValue(strategy = GenerationType.SEQUENCE)
    private Integer id;
    private String appurl;
    private String description;
    private String keyword;
    private Integer priority;
    private String curlresult;
    In the underlying database they are mapped by the table T_SERVERINSTANCE_T_APPURL
    What I need is a named query in the ServerInstance entity to find any AppUrl where curlresult = 'down'
    I tried the following:
    @NamedQuery
    (name = "findDownInstances", query = "SELECT i FROM ServerInstance i WHERE i.appUrl.result = 'down')
    This gave me the following error:
    invalid navigation expression [i.appUrl.result], cannot navigate collection valued association field [appUrl].
    Is there any way to create a query which will do what I want?
    Thanx in advance!

    can you provide the equivalent SQL (not JPQL!) query that you want, based on tables T_SERVERINSTANCE and T_APPURL, so that there are no misunderstandings ?

  • Need Help with complex query for productio database

    Hello again,
    i need your help again, for an query how Shows me how long every production step takes per Order.
    See sample data and what i expect.
    Thank you all for your help.
    We use Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
    Here the sample data tables:
    CREATE      TABLE      TABLE_2
    (     "ORDER_NR"      VARCHAR2 (12)
    ,      "PRIORITY"      VARCHAR2 (2)
    ,      "WO_STEP"      VARCHAR2 (1)
    ,      "STEP_DATE"      DATE
    CREATE      TABLE      TABLE_1
    (     "ORDER_NR"           VARCHAR2     (12) PRIMARY KEY
    ,      "PRIORITY"           VARCHAR2      (2)
    ,      "CREATE_DATE"      DATE
    ,     "ACT_STEP"          VARCHAR2     (2)
    ,     "STEP_DATE"          DATE
    ,     "EMPLOYEE"          VARCHAR2     (5)
    ,     "DESCRIPTION"     VARCHAR2     (20)
    INSERT      INTO      TABLE_1      (ORDER_NR,               PRIORITY,      CREATE_DATE,                                                        ACT_STEP,     STEP_DATE,                                                            EMPLOYEE,     DESCRIPTION)
                        VALUES           ('1KKA1T205634',     '12',          TO_DATE('10-FEB-13 10:00:00','DD-MON-RR HH24:MI:SS'),     'U',          TO_DATE('28-FEB-13 12:00:00','DD-MON-RR HH24:MI:SS'),     'W0010',     'CLEAN HOUSE');
    INSERT      INTO      TABLE_1      (ORDER_NR,               PRIORITY,     CREATE_DATE,                                                        ACT_STEP,     STEP_DATE,                                                            EMPLOYEE,     DESCRIPTION)
                        VALUES           ('1KKA1Z300612',     '12',          TO_DATE('08-FEB-13 14:00:00','DD-MON-RR HH24:MI:SS'),     'F',          TO_DATE('20-FEB-13 16:00:00','DD-MON-RR HH24:MI:SS'),     'K0052',     'REPAIR CAR');
    INSERT     INTO      TABLE_2      (ORDER_NR,               PRIORITY,     WO_STEP,     STEP_DATE)
                        VALUES           ('1KKA1T205634',     '12',          'A',          TO_DATE('12-FEB-13 13:00:00','DD-MON-RR HH24:MI:SS'));
    INSERT     INTO      TABLE_2      (ORDER_NR,               PRIORITY,     WO_STEP,     STEP_DATE)
                        VALUES           ('1KKA1T205634',     '12',          '5',          TO_DATE('13-FEB-13 09:00:00','DD-MON-RR HH24:MI:SS'));
    INSERT     INTO      TABLE_2      (ORDER_NR,               PRIORITY,     WO_STEP,     STEP_DATE)
                        VALUES           ('1KKA1T205634',     '12',          'K',          TO_DATE('13-FEB-13 10:00:00','DD-MON-RR HH24:MI:SS'));
    INSERT     INTO      TABLE_2      (ORDER_NR,               PRIORITY,     WO_STEP,     STEP_DATE)
                        VALUES           ('1KKA1T205634',     '12',          '5',          TO_DATE('13-FEB-13 11:00:00','DD-MON-RR HH24:MI:SS'));
    INSERT     INTO      TABLE_2      (ORDER_NR,               PRIORITY,     WO_STEP,     STEP_DATE)
                        VALUES           ('1KKA1T205634',     '12',          'K',          TO_DATE('13-FEB-13 12:00:00','DD-MON-RR HH24:MI:SS'));
    INSERT     INTO      TABLE_2      (ORDER_NR,               PRIORITY,     WO_STEP,     STEP_DATE)
                        VALUES           ('1KKA1T205634',     '12',          '5',          TO_DATE('13-FEB-13 16:00:00','DD-MON-RR HH24:MI:SS'));
    INSERT     INTO      TABLE_2      (ORDER_NR,               PRIORITY,     WO_STEP,     STEP_DATE)
                        VALUES           ('1KKA1T205634',     '12',          'C',          TO_DATE('14-FEB-13 08:00:00','DD-MON-RR HH24:MI:SS'));
    INSERT     INTO      TABLE_2      (ORDER_NR,               PRIORITY,     WO_STEP,     STEP_DATE)
                        VALUES           ('1KKA1T205634',     '12',          'B',          TO_DATE('14-FEB-13 10:00:00','DD-MON-RR HH24:MI:SS'));
    INSERT     INTO      TABLE_2      (ORDER_NR,               PRIORITY,     WO_STEP,     STEP_DATE)
                        VALUES           ('1KKA1T205634',     '12',          'E',          TO_DATE('18-FEB-13 13:00:00','DD-MON-RR HH24:MI:SS'));
    INSERT     INTO      TABLE_2      (ORDER_NR,               PRIORITY,     WO_STEP,     STEP_DATE)
                        VALUES           ('1KKA1T205634',     '12',          'F',          TO_DATE('20-FEB-13 16:00:00','DD-MON-RR HH24:MI:SS'));
    INSERT     INTO      TABLE_2      (ORDER_NR,               PRIORITY,     WO_STEP,     STEP_DATE)
                        VALUES           ('1KKA1T205634',     '12',          'S',          TO_DATE('21-FEB-13 08:00:00','DD-MON-RR HH24:MI:SS'));
    INSERT     INTO      TABLE_2      (ORDER_NR,               PRIORITY,     WO_STEP,     STEP_DATE)
                        VALUES           ('1KKA1T205634',     '12',          'R',          TO_DATE('21-FEB-13 09:00:00','DD-MON-RR HH24:MI:SS'));
    INSERT     INTO      TABLE_2      (ORDER_NR,               PRIORITY,     WO_STEP,     STEP_DATE)
                        VALUES           ('1KKA1T205634',     '12',          'U',          TO_DATE('28-FEB-13 12:00:00','DD-MON-RR HH24:MI:SS'));
    INSERT     INTO      TABLE_2      (ORDER_NR,               PRIORITY,     WO_STEP,     STEP_DATE)
                        VALUES           ('1KKA1Z300612',     '12',          'A',          TO_DATE('12-FEB-13 13:52:42','DD-MON-RR HH24:MI:SS'));
    INSERT     INTO      TABLE_2      (ORDER_NR,               PRIORITY,     WO_STEP,     STEP_DATE)
                        VALUES           ('1KKA1Z300612',     '12',          '5',          TO_DATE('13-FEB-13 09:00:00','DD-MON-RR HH24:MI:SS'));
    INSERT     INTO      TABLE_2      (ORDER_NR,               PRIORITY,     WO_STEP,     STEP_DATE)
                        VALUES           ('1KKA1Z300612',     '12',          'K',          TO_DATE('13-FEB-13 10:00:00','DD-MON-RR HH24:MI:SS'));
    INSERT     INTO      TABLE_2      (ORDER_NR,               PRIORITY,     WO_STEP,     STEP_DATE)
                        VALUES           ('1KKA1Z300612',     '12',          '5',          TO_DATE('13-FEB-13 11:00:00','DD-MON-RR HH24:MI:SS'));
    INSERT     INTO      TABLE_2      (ORDER_NR,               PRIORITY,     WO_STEP,     STEP_DATE)
                        VALUES           ('1KKA1Z300612',     '12',          'K',          TO_DATE('13-FEB-13 12:00:00','DD-MON-RR HH24:MI:SS'));
    INSERT     INTO      TABLE_2      (ORDER_NR,               PRIORITY,     WO_STEP,     STEP_DATE)
                        VALUES           ('1KKA1Z300612',     '12',          '5',          TO_DATE('13-FEB-13 16:00:00','DD-MON-RR HH24:MI:SS'));
    INSERT     INTO      TABLE_2      (ORDER_NR,               PRIORITY,     WO_STEP,     STEP_DATE)
                        VALUES           ('1KKA1Z300612',     '12',          'C',          TO_DATE('14-FEB-13 08:00:00','DD-MON-RR HH24:MI:SS'));
    INSERT     INTO      TABLE_2      (ORDER_NR,               PRIORITY,     WO_STEP,     STEP_DATE)
                        VALUES           ('1KKA1Z300612',     '12',          'B',          TO_DATE('14-FEB-13 10:00:00','DD-MON-RR HH24:MI:SS'));
    INSERT     INTO      TABLE_2      (ORDER_NR,               PRIORITY,     WO_STEP,     STEP_DATE)
                        VALUES           ('1KKA1Z300612',     '12',          'E',          TO_DATE('18-FEB-13 13:00:00','DD-MON-RR HH24:MI:SS'));
    INSERT     INTO      TABLE_2      (ORDER_NR,               PRIORITY,     WO_STEP,     STEP_DATE)
                        VALUES           ('1KKA1Z300612',     '12',          'F',          TO_DATE('20-FEB-13 16:00:00','DD-MON-RR HH24:MI:SS'));
    COMMIT;And here is what i expect from my query:
    SYSDATE     28.Feb.13 14:00                                                                                     
    ORDER_NR     PRIORITYCREATE_DATE     STATUS     STATUS_DATE     DESCRIPTION     AGE_1     AGE_2     WAITNG     STEP_A     STEP_B     STEP_C     STEP_5     STEP_K     STEP_E     STEP_F     STEP_S     STEP_R     
    1KKA1T205634     12     10.Feb.13 10:00     U     28.Feb.13 12:00     CLEAN HOUSE     18,083     8,833     2,125     0,833     4,125     0,083     0,750     0,208     2,125     0,666     0,042     7,125     
    1KKA1Z300612     12     08.Feb.13 14:00     F     20.Feb.13 16:00     REPAIR CAR     20,000     16,042     2,125     0,833     4,125     0,083     0,750     0,208     2,125     0,666          And now the explanation to the query result:
    The AGE_1 is the difference in days between the 'CREATE_DATE' and IF EXSIST the STEP 'U' then STEP_DATE or if the STEP 'U' is not found in TABLE_2 then it should show the difference in days between the 'CREATE_DATE' and the 'SYSDATE'
    The AGE_2 is the difference in days between the STEP 'A' STEP_DATE and IF EXSIST the STEP 'R' then STEP_DATE or if the STEP 'R' is not found in TABLE_2 then it should show the difference in days between the 'CREATE_DATE' and the 'SYSDATE'
    The WAITING is the difference in days between CREATE_DATE and STEP 'A' STEP_DATE
    The following columns show the days how long the ORDER_NR stays in these STEP, if an ORDER_NR comes into the same STEP more then one time it should be calculated together.
    If the ORDER_NR skips a step it should show a zero in the specific field.
    I hope my explanation is good enough, my english skills are far away from good.
    Thanks all for your help.
    Greets Reinhard W.

    Hi,
    i changed this query:
    with t2 as (
                select  t.*,
                        lead(step_date) over(partition by order_nr order by step_date) next_step_date
                  from  table_2 t
    select  t1.*,
            nvl(
                max(
                    case t2.wo_step
                      when 'U' then t2.step_date
                    end
               sysdate
              ) - t1.create_date age_1,
            nvl(
                max(
                    case t2.wo_step
                      when 'R' then t2.step_date
                    end
               sysdate
              ) - t1.create_date age_2,
            sum(
                case t2.wo_step
                  when 'B' then t2.next_step_date - t2.step_date
                end
               ) step_b
      from  table_1 t1,
            t2
      where t2.order_nr = t1.order_nr
      group by t1.order_nr,
               t1.priority,
               t1.create_date,
               t1.act_step,
               t1.step_date,
               t1.employee,
               t1.descriptionTo this:
    with t2 as (
                select  t.*,
                        lead(step_date) over(partition by order_nr order by step_date) next_step_date
                  from  table_2 t
    select  t1.order_nr,
            nvl(
                max(
                    case t2.wo_step
                      when 'U' then t2.step_date
                    end
               sysdate
              ) - t1.create_date age_1,
            nvl(
                max(
                    case t2.wo_step
                      when 'R' then t2.step_date
                    end
               sysdate
              ) - t1.create_date age_2,
            sum(
                case t2.wo_step
                  when 'B' then t2.next_step_date - t2.step_date
                end
               ) step_b
      from  table_1 t1,
            t2
      where t2.order_nr = t1.order_nr
      group by t1.order_nrthen i get the ORA-00979 Error.
    Whats wrong?
    I have another question.
    How can i handle i i want to group to or more 'STEP's in one Column.
    in Case of this i want that the column 'STEP_B' contains all days for STEP 'B' and STEP '5'.
    I tried already with a + Operation like this:
    with t2 as (
                select  t.*,
                        lead(step_date) over(partition by order_nr order by step_date) next_step_date
                  from  table_2 t
    select  t1.*,
            nvl(
                max(
                    case t2.wo_step
                      when 'U' then t2.step_date
                    end
               sysdate
              ) - t1.create_date age_1,
            nvl(
                max(
                    case t2.wo_step
                      when 'R' then t2.step_date
                    end
               sysdate
              ) - t1.create_date age_2,
            Round( sum(
                case t2.wo_step
                  when 'B' then t2.next_step_date - t2.step_date
                end
               ) +
            sum(
                case t2.wo_step
                  when '5' then t2.next_step_date - t2.step_date
                end
               ), 3 ) step_b
      from  table_1 t1,
            t2
      where t2.order_nr = t1.order_nr
      group by t1.order_nr,
               t1.priority,
               t1.create_date,
               t1.act_step,
               t1.step_date,
               t1.employee,
               t1.descriptionBut this does reply evertime a NULL.
    Thank You.

  • Need to adjust SQL query for left outer join in Crystal Reports 2008.

    I need to change this SQL 2005 query.....
    SELECT     omnicell_anl.DeviceIDsLastMetricTable.member_id, omnicell_anl.DeviceIDsLastMetricTable.[Device Name],
                          omnicell_anl.DeviceIDsLastMetricTable.Account, omnicell_anl.labeledLastMetrics.PROPERTY_NAME,
                          omnicell_anl.labeledLastMetrics.latest_monitor_value
    FROM         omnicell_anl.DeviceIDsLastMetricTable LEFT OUTER JOIN
                          omnicell_anl.labeledLastMetrics ON omnicell_anl.DeviceIDsLastMetricTable.member_id = omnicell_anl.labeledLastMetrics.member_id
    WHERE
        omnicell_anl.labeledLastMetrics.PROPERTY_NAME = ?MyProperty
    To this query in Crystal Reports Report Writer:
    SELECT     omnicell_anl.DeviceIDsLastMetricTable.member_id, omnicell_anl.DeviceIDsLastMetricTable.[Device Name],
                          omnicell_anl.DeviceIDsLastMetricTable.Account, omnicell_anl.labeledLastMetrics.PROPERTY_NAME,
                          omnicell_anl.labeledLastMetrics.latest_monitor_value
    FROM         omnicell_anl.DeviceIDsLastMetricTable LEFT OUTER JOIN
                          omnicell_anl.labeledLastMetrics ON omnicell_anl.DeviceIDsLastMetricTable.member_id = omnicell_anl.labeledLastMetrics.member_id AND
                          omnicell_anl.labeledLastMetrics.PROPERTY_NAME = ?MyProperty
    I can't seem to get the left outer join function of Crystal Reports to emulate the same SQL query in SQL 2005.  Any ideas on how I can create this same query in Crystal 2008?
    Thanks,
    Dominic
    Edited by: Dominic Carissimi on Oct 28, 2008 7:55 PM
    Edited by: Dominic Carissimi on Oct 28, 2008 7:56 PM

    If you want the list of values for command level parameter then you need to add another command like
    select PropertyField from table
    and delete the links between this command and the existing command.
    Now go to field explorer and edit the command level parameter and make it as dynamic and add the property field from newly added command.
    Hope this helps!
    Raghavendra

  • Select query for sum(QTY) of week

    Hi I have a source table as
    LOCATIONID NOT NULL VARCHAR2(200) eg:-ABC, ACD etc
    IPC NOT NULL VARCHAR2(200) eg:- 12345,13245 etc
    PRODUCTIONDATE NOT NULL VARCHAR2(200) eg:- 20120524,20120524. has data from 20111124 to 20121030
    QUANTITY VARCHAR2(2000) eg:- 0012365,0012356,0012456 etc
    PRODUCTIONCODE VARCHAR2(2000) eg:- AS123, AD154 etc
    MOULDQUANTITY VARCHAR2(2000) eg:- 00256,00236etc
    Now from this table i want to derive query satisfying following conditions.
    need to derive STARTDATE which shopuld be the Monday of the week.
    Need to derive QUANTITY should be the total quantity for the IPC , procutioncode and locationid from 1st of day of the week (Monday) to last day of the week included (Sunday).
    How can i do this.
    I am facing mainly problem in deriving quantity whch might can be derived by group by but confised on what should i group by. :(
    Can anyone/Experts help me out for building this query.
    Oracle version :- Oracle Database 11g Release 11.2.0.1.0 -64bit Production
    Source Data Example:-
    LOCATIONID IPC          PRODUCTIONDATE          QUANTITY          PRODUCTIONCODE     MOULDQUANTITY
    MPL1               3064               20120521               000000000               FG58E               0
    MPL1               3064               20120522               000000000               FG58E               0
    MPL1               3064               20120523               000000000               FG58E               0
    MPL1               3064               20120524               000000000               FG58E               0
    MPL1               3064               20120525               000000000               FG58E               0
    MPL1               3064               20120526               000000000               FG58E               0
    MPL1               3064               20120527               000000000               FG58E               0
    MPL1               3064               20120528               000000000               FG58E               0
    MPL1               3064               20120529               000000000               FG58E               0
    MPL1               3064               20120530               000000000               FG58E               0
    MPL1               3064               20120531               000000000               FG58E               0
    MPL1               3064               20120601               000000000               FG58E               0
    MPL1               3064               20120602               000000000               FG58E               0
    MPL1               3064               20120603               000000000               FG58E               0
    MPL1               3064               20120604               000000000               FG58E               0
    MPL1               3064               20120605               000000000               FG58E               0
    MPL1               3064               20120606               000000000               FG58E               0
    MPL1               3064               20120607               000000000               FG58E               0
    MPL1               3064               20120608               000000000               FG58E               0
    MPL1               3064               20120609               000000000               FG58E               0
    MPL1               3064               20120610               000000000               FG58E               0
    MPL1               3064               20120611               000000000               FG58E               0
    MPL1               3064               20120612               000000000               FG58E               0
    MPL1               3064               20120613               000000000               FG58E               0
    MPL1               3064               20120614               000000000               FG58E               0
    MPL1               3064               20120615               000000000               FG58E               0
    MPL1               3064               20120616               000000000               FG58E               0
    MPL1               3064               20120617               000000000               FG58E               0
    MPL1               3064               20120618               000020100               FG58E               2
    MPL1               3064               20120619               000020100               FG58E               2
    MPL1               3064               20120620               000018400               FG58E               2
    MPL1               3064               20120621               000000000               FG58E               2
    MPL1               3064               20120622               000015100               FG58E               2
    MPL1               3064               20120623               000020100               FG58E               2
    MPL1               3064               20120624               000020100               FG58E               2
    MPL1               3064               20120625               000000000               FG58E               0
    MPL1               3064               20120626               000000000               FG58E               0
    MPL1               3064               20120627               000000000               FG58E               0
    MPL1               3064               20120628               000000000               FG58E               0
    MPL1               3064               20120629               000000000               FG58E               0
    MPL1               3064               20120630               000000000               FG58E               0
    MPL1               3064               20120701               000000000               FG58E               0
    MPL1               3064               20120702               000032600               FG58E               4
    MPL1               3064               20120703               000032600               FG58E               4
    MPL1               3064               20120704               000032600               FG58E               4
    MPL1               3064               20120705               000032600               FG58E               4
    MPL1               3064               20120706               000032600               FG58E               4
    MPL1               3064               20120707               000032600               FG58E               4
    MPL1               3064               20120708               000032600               FG58E               4
    Destination from it
    IPCCODE     PRODUCTIONCODE     STARTDATE     WEEKREQUIREMENT
    3064          FG58E          20120521          0
    3064          FG58E          20120528          0
    3064          FG58E          20120604          0
    3064          FG58E          20120611          0
    3064          FG58E          20120618          1139
    3064          FG58E          20120625          0
    3064          FG58E          20120702          2282
    Thanks,
    Mahesh
    Edited by: MaheshGx on May 24, 2012 2:54 PM

    Hi, Mahesh,
    MaheshGx wrote:
    Hi I have a source table as
    LOCATIONID NOT NULL VARCHAR2(200) eg:-ABC, ACD etc
    IPC NOT NULL VARCHAR2(200) eg:- 12345,13245 etc
    PRODUCTIONDATE NOT NULL VARCHAR2(200) eg:- 20120524,20120524. has data from 20111124 to 20121030 Information about dates belongs in DATE columns, not VARCHAR2.
    If the values are all 8 characters long, why does productiondate allow values up to 200 characters long?
    QUANTITY VARCHAR2(2000) eg:- 0012365,0012356,0012456 etcInformation that is a number belongs in a NUMBER column, not a VARCHAR2.
    Why do you allow 2000 characters in quantity? Are you expecting numbers with 2000 digits?
    PRODUCTIONCODE VARCHAR2(2000) eg:- AS123, AD154 etc
    MOULDQUANTITY VARCHAR2(2000) eg:- 00256,00236etc
    Now from this table i want to derive query satisfying following conditions.
    need to derive STARTDATE which shopuld be the Monday of the week.TRUNC (dt, 'IW') is the Monday on or before dt, where dt is a DATE. For example, if dt is any time between 00:00:00 on Monday, May 21, 2012 and 23:59:59 on Sunday, May 27, 2012 (including both end-points), then TRUNC (dt, 'IW') returns 00:00:00 May 21, 2012.
    Use TO_DATE (productiondate, 'YYYYMMDD') to make a DATE from a VARCHAR2, such as '20120524'.
    Need to derive QUANTITY should be the total quantity for the IPC , procutioncode and locationid from 1st of day of the week (Monday) to last day of the week included (Sunday).
    How can i do this.
    I am facing mainly problem in deriving quantity whch might can be derived by group by but confised on what should i group by. :(
    GROUP BY  ipc
    ,         productioncode
    ,         locationid
    ,         TRUNC ( TO_DATE (productiondate, 'YYYYMMDD')
                    , 'IW'
    Can anyone/Experts help me out for building this query.
    Thanks,
    MaheshI hope this answers your question.
    If not, 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.

  • Need help with sq01 query for FI data

    hello,
      i have created a simple query whihc requires document header and line item information , bkpf and bsis works for this, but another requirement is that business needs vendor and customer accounts to be displayed also .
    bsis does not have vendor and customer , bseg has this info but bseg cannot be used in query ,
    kindly assist with this , thanks in advance.

    hi,
    you'll find the required info in BSID (customers) and BSIK (vendors) tables (BSAD and BSAK for closed items).
    hope this helps
    ec

  • Need to execute Dynamic query for the report

    I was wondering if we can have the option of choosing at runtime from the report builder parameter so that if the end-user selects 'Yes' then the report will run one specific query and if he chooses 'No' then another particular query is invoked. What I mean to say that by choosing between Yes and No at runtime one should have the option of returning query results based on the same table but having different columns selected via the SELECT statement
    means we have two querires on our report & upon the chosen parameter we should execute only one of them ... wht should i do to apply tht ???

    As the previous post noted lexicals are a terrific way to accomplish dynamic queries in Oracle reports.
    Another way you could accomplish this would be to use a UNION, whereas the first select in the UNION represents one user option, then second query represents the second option.
    For example:
    SELECT customer_name name, customer_address address
    FROM customer_table
    WHERE :p_choice = 'Customer Info'
    UNION
    SELECT employee_name name, employee_address address
    FROM employee_table
    WHERE :p_choice = 'Employee Info'If when running the report, the user chooses 'Customer Info' the first query would return results, if the user chose 'Employee Info' then just information from the second query would return information.
    So there are different ways to accomplish what you are looking for, you just need to find which is going to work best for you.
    Hope this helps!

  • Re:Query for Stock Statement for a particular item..!!!!

    Dear SAP Experts,
    I need a stock statement query  for a particular item which contains:
    1.ItemCode
    2.Item Description
    3.Item Price
    4.Opening
    5.Receipts
    6.Issues
    7.Closing
    8. Value
    The selection criteria are:
    1.Warehouse code
    2.Item Name
    3.Posting Date
    Plz give me a good solution for this issue.
    With Regards,
    Revathy

    Check this
    Declare @FromDate Datetime
    Declare @ToDate Datetime
    set @FromDate =
        (Select min(S0.Docdate) from OINM S0 where S0.Docdate >='[%0]')
    set @ToDate =
        (Select max(S1.Docdate) from OINM S1 where S1.Docdate <='[%1]')
    select * from
        SELECT T0.itemcode,
        min(T0.Dscription) as 'Item Description',
        min(B1.ItmsGrpNam) as 'Item Group', W1.Whscode, C1.Location,
        (isnull((
            Select sum(isnull(inqty,0))
            from OINM O1
            where O1.itemcode=T1.itemcode
            and O1.Warehouse=W1.Whscode
            and O1.docdate<@FromDate ),0)-
        isnull((
            Select sum(isnull(outqty,0))
            from OINM O1
            where O1.itemcode=T1.itemcode
            and O1.Warehouse=W1.Whscode
            and O1.docdate<@FromDate),0)
        ) as [Opening Stock],
        isnull((
            Select sum(isnull(inqty,0))
            from OINM O1
            where O1.itemcode=T1.itemcode
            and O1.Warehouse=W1.Whscode
            and O1.docdate>=@FromDate
            and O1.docdate<=@ToDate and O1.inqty>0
            and O1.transtype in (20,18)),0
        ) as [Purchase Quantity],
        isnull((
            Select sum(isnull(outqty,0))
            from OINM O1
            where O1.itemcode=T1.itemcode and O1.Warehouse=W1.Whscode
            and O1.docdate>=@FromDate and O1.docdate<=@ToDate
            and O1.outqty>0 and O1.transtype in (21,19)),0
        ) as [Purchase Return Quantity],
       isnull((
            Select sum(isnull(outqty,0))
            from OINM O1
            where O1.itemcode=T1.itemcode and O1.Warehouse=W1.Whscode
            and O1.docdate>=@FromDate and O1.docdate<=@ToDate and O1.outqty>0
            and O1.transtype in (13,15)),0
        ) as [sale Quatity],
        (isnull
            Select sum(isnull(inqty,0))
            from OINM O1
            where O1.itemcode=T1.itemcode and O1.Warehouse=W1.Whscode
            and O1.docdate<=@ToDate),0
            isnull((
                Select sum(isnull(outqty,0))
                from OINM O1
                where O1.itemcode=T1.itemcode and O1.Warehouse=W1.Whscode
                and O1.docdate<=@ToDate),0)
        ) as [Closing Stock]
        FROM OINM T0
        INNER JOIN OITM T1 ON T0.ItemCode = T1.ItemCode
        INNER JOIN OITW T2 ON T1.ItemCode = T2.ItemCode
        INNER JOIN OITB B1 ON T1.ItmsGrpCod=B1.ItmsGrpCod
        INNER JOIN OWHS W1 ON T2.WhsCode = W1.WhsCode
        INNER JOIN OLCT C1 ON W1.Location=C1.Code
        Group by T1.itemcode, T0.Itemcode, W1.WhsCode, C1.Location
    ) a
    where (a.[Opening Stock]
            +a.[Purchase Quantity]
            + a.[Purchase Return Quantity]
            +a.[sale Quatity]+a.[Closing Stock]
           ) !=0
    Regards,
    Bala

  • QUERY FOR GOODS RETURN -- GRPO -- PO HISTORY

    HI Folks
    I need to write a query for the following requirement.
    Goods Return
    It's Base GRPO (no & date)
    and it's PO (date & no)
    The above fields should be in the same query.
    Can anyone help me on this please.
    regards
    karthik

    Hi
    Select  T0.Project AS 'Job Number', T0.DocDate as [Date of Goods Return],T0.DocNum As [Good Return Number],T2.DocNum as [GRPO Number],
    T2.DocDate as [GRPO Date],T4.DocNum as [PO Number],T4.DocDate as [PO Date],T0.CardName as 'Vendor Name',SUM(t1.linetotal) as ' Basic'  
    FROM ORPD T0
              Inner Join RPD1 T1 on T0.DocEntry=T1.DocEntry
              Inner Join OPDN T2 on T1.BaseEntry=T2.DocEntry and T1.BaseType='20'
              Inner Join PDN1 T3 on T2.DocEntry=T3.DocEntry
              Inner Join OPOR T4 on T4.DocEntry = T3.BaseEntry and T3.BaseType ='22'
    GROUP BY T0.Project , T0.DocDate,T0.DocNum,T2.DocNum,
    T2.DocDate ,T4.DocNum ,T4.DocDate ,T0.CardName
    *When i run this query the BASIC amt is calculated by Multiplying basic * no of line items. Can anybody guide me where changes has to be made. And also i am going to add Freight,Excise,CST & VAT at document level in thus query.*
    regARDS
    KARTHIK

  • Need help on a query

    Hi gurus,
    I need to make one query for material sales. The query should contain the comparative sales (by date) made for the material group and distribution channel. I don't have any idea how to make this.
    I tried in the follow way: I used the 2LIS_11_VAHDR and 2LIS_11_VAITM (DS for the header and the position of the sales documents. In the header I put AUDAT - date of sale command, used for the comparator). I make two cubes, each one having:
      first one:
                 - audat1 (characteristic)
                 - material group (characteristic)
                 - distribution channel (characteristic)
                 - net value1 (key)
       second one:
                 - audat2 (characteristic)
                 - material group (characteristic)
                 - distribution channel (characteristic)
                 - net value2 (key)
    After this I make a MultiProvider which contain the cubes. When I make the query using this multiprovider,
    I put on the selection audat1 and audat2, on the column I put the distribution channel, and on the row I put the material group, net value 1 and net value 2. (I need another row for the % = ( net value1 - net value2 ) / 100, but I was not able to create the field). Unfortunate, when  try to open the query using the analyzer, it give the error: "variable 0REDAY1 is used for two different characteristic".
    I need to now if it is other possibilities for this kind of query's,  or, how to solve the error.
    Tank you

    Hi Gabriel,
    Just check in query designer that are there any variables created in filters or keyfigures (restriction), or Restricted Key figures.
    If so, please check whether there is any variable on the same character.
    Like 0comp_code -->variable 1 in filters
    0comp_code-->variable 2 in RKF's.
    This is the reason you get the error in the BEx Analyzer.
    Regards,
    Ravi Kanth

Maybe you are looking for

  • 16:9 Setting in Compressor 3 versus Compressor 2? URGENT...

    I just upgraded to FCS2 from FCS and I have a question about Compressor 3. In Compressor 2 you had 4:3 and 16:9 presets for each sample preset (i.e. 120 minute DVD Best Quality). In Compressor 3 you no longer have this, just one preset for each bitra

  • How to get the best sound from iMac?

    Has anyone heard of "Pure Music"?  Supposedly it's able to make music sound better.  I downloaded it for a 15 day trial but haven't figured out how to get it to work with itunes radio.  I'm using Klipsch 2.1 speakers with a late '13 iMac 3.1 quad cor

  • C/I functions introduction after go live

    Hello Experts, What are the necessary steps required to use Consolidation of Investment functionality BCS 4.0 after it has already gone live since 2 years? Is generation of data stream of Equity and Equity Holding adjustment data, going to pose any p

  • Help! Receiving "File is not a resource file" message when trying to open my VI.

    I have been working on this VI for a few days now and it seems to have been corrupted (for no apparent reason) just as I was adding the finishing touches.  I have seen in a related post that <CR><LF> delimiters can get converted by say a mail server,

  • Information for sale posting.

    Dear expertise, this is deepak working in IS RETAIL (ECC 5.0) , i faced some problem in sale  posting like we are using RXL for our billing purpose which helps to XI' server for transfer data to SAP. but the problem is when our FI team close the sess