Pls help with extracting dates

I wish to produce the output in table customer1 based on the customer table DOP field.
The values in DOP (0030500) indicates wed and fri, (0000007) indicates sunday.
how can i extract all the dates for wed and fri (0030500) between the period ST_DT and ED_DT (23/02/2005) to (20/03/2005).
SQL> select * from customer;
CUSTOMER_ID ST_DT ED_DT DOP
429100 23/02/2005 20/03/2005 0030500
428950 14/03/2005 02/04/2005 0000007
SQL> select * from customer1;
CUSTOMER_ID ST_DT ED_DT DOP DT
429100 23/02/2005 20/03/2005 0030500 23/02/2005
429100 23/02/2005 20/03/2005 0030500 25/02/2005
429100 23/02/2005 20/03/2005 0030500 02/03/2005
429100 23/02/2005 20/03/2005 0030500 04/03/2005
429100 23/02/2005 20/03/2005 0030500 09/03/2005
429100 23/02/2005 20/03/2005 0030500 11/03/2005
429100 23/02/2005 20/03/2005 0030500 16/03/2005
429100 23/02/2005 20/03/2005 0030500 18/03/2005
428950 14/03/2005 02/04/2005 0000007 20/03/2005
428950 14/03/2005 02/04/2005 0000007 27/03/2005
pls help, thanks.

SQL> select * from customer;
CUSTOMER_ID ST_DT     END_DT    DOP
     429100 23-FEB-05 20-MAR-05 0030500
     428950 14-MAR-05 02-APR-05 0000007
SQL> select a.customer_id,a.st_dt,a.end_dt,a.dop,a.st_dt+b.tita
  2  from customer a,(select rownum-1 tita from user_objects) b
  3  where a.st_dt+b.tita <= a.end_dt
  4  and instr(a.dop,decode(to_char(a.st_dt+b.tita,'d')-1,0,7,to_char(a.st_dt+b.tita,'d')-1))>0
  5  order by a.customer_id,a.st_dt+b.tita;
CUSTOMER_ID ST_DT     END_DT    DOP     A.ST_DT+B
     428950 14-MAR-05 02-APR-05 0000007 20-MAR-05
     428950 14-MAR-05 02-APR-05 0000007 27-MAR-05
     429100 23-FEB-05 20-MAR-05 0030500 23-FEB-05
     429100 23-FEB-05 20-MAR-05 0030500 25-FEB-05
     429100 23-FEB-05 20-MAR-05 0030500 02-MAR-05
     429100 23-FEB-05 20-MAR-05 0030500 04-MAR-05
     429100 23-FEB-05 20-MAR-05 0030500 09-MAR-05
     429100 23-FEB-05 20-MAR-05 0030500 11-MAR-05
     429100 23-FEB-05 20-MAR-05 0030500 16-MAR-05
     429100 23-FEB-05 20-MAR-05 0030500 18-MAR-05
10 rows selected.
SQL> Assuming the date range does not exceed the number of user objects :-)

Similar Messages

  • HT201299 HOW TO INSERT MICRO SIM IN I PAD MODEL- A1416? Pls help with a picture...

    HOW TO INSERT MICRO SIM IN I PAD MODEL- A1416? Pls help with a picture...

    My Ipad doesnt have the space to pin out the sim card tray...?
    I think i have been gifted the Ipad which doesnt support sim card. Is it so?
    My model no is- A1416....?

  • Pls Help with this

    Hi,
    I need a help to resolve my problem.Actually i have a JSP page with a list box. When i select some value in the list box, appropriate values must list out according to the selected value.And i have a submit button to process that jsp page.
    I wrote a validation as all the fields must be entered to submit a page.
    But when i tried with the following code,it's just moving to processing page when i select a values from the list box.This is happening when i cheked the validation.
    Pls help with this code.This is very urgent.
    Code is as follows
    "Example1.jsp"
    <%
    String str1 = request.getParameter("Modem");
    %>
    <html>
    <head>
    <script language = "JavaScript">
    function Validate()
    if(document.UpdateFiosAccounts.Modem.value == "Select One")
    alert("Please select the value")
    document.UpdateFiosAccounts.Modem.focus()
    return false
    if(document.UpdateFiosAccounts.text1.value == "")
    alert("Please type some text")
    document.UpdateFiosAccounts.text1.focus()
    return false
    return true
    </script>
    </head>
    <body>
    <form name = "UpdateFiosAccounts" action="./Example1.jsp" method ="post" onSubmit= "return Validate()">
    Pls select One:<select name="Modem" size="1" onChange="document.UpdateFiosAccounts.submit()">
    <%
    if(str1 == null)
    %>
         <option value="Select One">Select One</option>
         <option value="One">One</option>
         <option value="Two">Two</option>
         <option value="Three">Three</option>
         <option value="Four">Four</option>
    <%
    else
    %>
         <option value="<%=str1%>"><%=str1%></option>
    <%
    %>
    </select><br>
    Pls type something: <input type ="text" name="text1">
    <input type ="submit" value="submit" onClick="document.UpdateFiosAccounts.action='./Accounts.jsp'">
    </form>
    </body>
    </html>

    Hi! The reason is that in the onChange property you are doing the submit, so, when you select something, it goes automatically and never pases through your validation function. So, remove that onChange. Next, the button is a submit buton, so, no matter what your validation does, the page will go. You need to change the submit type of the button to just button (<input type="button" onclick="function to validate">) and then you will get what you want. By the way, this is NOT a Java question, is more JavaScript question.
    Hope this helps.

  • Pls Help with date format picture ends ......error

    Hi Everyone,
       I am getting the following error when I run my crystal report.
    Failed to retrieve data from the database.
    Details: HY000:[DataDirect][ODBC Oracle driver][Oracle]ORA-01830: date format picture ends before converting entire input string
    [Database Vendor Code: 1830]
       I am using SQL Command for my report and in the command  my date fields are of "Date" datatype.
       I am using Crystal Reports XI R2,driver - CR Oracle ODBC Driver 5.1
       Any help is greatly appreciated.
    Thanks in advance
    My SQL Command is as follows:
    <
    with MAXNEWSTAT as
    (select
    /--Added by HAN--/
    HRHISTORY.COMPANY,
    HRHISTORY.EMPLOYEE,
    MAX(HRHISTORY.ACT_OBJ_ID) ACT_OBJ_ID
    FROM
    LAWSON.HRHISTORY
    WHERE
    HRHISTORY.FLD_NBR=20
    and TO_DATE(HRHISTORY.DATE_STAMP)
        >= TO_DATE((TO_CHAR((ADD_MONTHS(SYSDATE,-1)),'YYYY/MM')||'/01'),'YYYY/MM/DD') 
        AND  TO_DATE(HRHISTORY.DATE_STAMP) <= (TO_DATE((TO_CHAR((ADD_MONTHS(SYSDATE,0)),'YYYY/MM')||'/01'),'YYYY/MM/DD'))-1
    /--Added by HAN--/
        GROUP BY COMPANY,
        EMPLOYEE),
    NEWSTAT AS
    (SELECT
    /--Added by HAN--/
    HRHISTORY.COMPANY,
    HRHISTORY.EMPLOYEE,
    HRHISTORY.A_VALUE,
    HRHISTORY.DATE_STAMP,
    HRHISTORY.BEG_DATE,
    HRHISTORY.ACT_OBJ_ID NS_OBJ_ID,
    HRHISTORY.SEQ_NBR
    FROM
    LAWSON.HRHISTORY
    INNER JOIN LAWSON.MAXNEWSTAT
    ON
    /--Added by HAN--/
    HRHISTORY.COMPANY = MAXNEWSTAT.COMPANY
    /--Added by KAM--/
    AND HRHISTORY.EMPLOYEE = MAXNEWSTAT.EMPLOYEE
    AND HRHISTORY.ACT_OBJ_ID = MAXNEWSTAT.ACT_OBJ_ID
    WHERE
    HRHISTORY.FLD_NBR=20
    and TO_DATE(HRHISTORY.DATE_STAMP)
        >= TO_DATE((TO_CHAR((ADD_MONTHS(SYSDATE,-1)),'YYYY/MM')||'/01'),'YYYY/MM/DD') 
        AND  TO_DATE(HRHISTORY.DATE_STAMP) <= (TO_DATE((TO_CHAR((ADD_MONTHS(SYSDATE,0)),'YYYY/MM')||'/01'),'YYYY/MM/DD'))-1
    PREVSTATID AS
    (SELECT
    /--Added by HAN--/
    HRHISTORY.COMPANY,
    HRHISTORY.EMPLOYEE,
    MAX(HRHISTORY.ACT_OBJ_ID)OBJ_ID
    FROM
    LAWSON.HRHISTORY
        INNER JOIN LAWSON.NEWSTAT
    /--Added by HAN--/
        ON HRHISTORY.COMPANY = NEWSTAT.COMPANY
        AND HRHISTORY.EMPLOYEE = NEWSTAT.EMPLOYEE
    WHERE
    HRHISTORY.FLD_NBR=20
    AND TO_DATE(HRHISTORY.BEG_DATE)
    < to_date(NEWSTAT.BEG_DATE)
    GROUP BY
    /--Added by HAN--/
    HRHISTORY.COMPANY,
    HRHISTORY.EMPLOYEE
    PREVSTAT AS
    (SELECT
    /--Added by HAN--/
    HRHISTORY.COMPANY,
    HRHISTORY.EMPLOYEE,
    HRHISTORY.A_VALUE A_VALUE,
    HRHISTORY.DATE_STAMP DATE_STAMP,
    HRHISTORY.BEG_DATE BEG_DATE,
    HRHISTORY.ACT_OBJ_ID OBJ_ID,
    HRHISTORY.SEQ_NBR SEQ_NBR
    FROM
    LAWSON.HRHISTORY
        INNER JOIN LAWSON.PREVSTATID
    /--Added by HAN--/
        ON HRHISTORY.COMPANY = PREVSTATID.COMPANY
        AND HRHISTORY.EMPLOYEE = PREVSTATID.EMPLOYEE
    WHERE
    HRHISTORY.FLD_NBR=20 AND
    HRHISTORY.ACT_OBJ_ID = PREVSTATID.OBJ_ID
    MAXPERSACTHST AS
    (SELECT
    PERSACTHST.EMPLOYEE,
    /--Added by KAM--/
    PERSACTHST.COMPANY,
    MAX(PERSACTHST.DATE_STAMP)DATE_STAMP
    FROM
    LAWSON.PERSACTHST
    WHERE
    (PERSACTHST.ACTION_CODE='LOASTATUS' OR PERSACTHST.ACTION_CODE='STATUS')
    AND TO_DATE(PERSACTHST.DATE_STAMP)
        >= TO_DATE((TO_CHAR((ADD_MONTHS(SYSDATE,-1)),'YYYY/MM')||'/01'),'YYYY/MM/DD') 
        AND  TO_DATE(PERSACTHST.DATE_STAMP) <= (TO_DATE((TO_CHAR((ADD_MONTHS(SYSDATE,0)),'YYYY/MM')||'/01'),'YYYY/MM/DD'))-1
    GROUP BY PERSACTHST.EMPLOYEE,
    /--Added by KAM--/
    PERSACTHST.COMPANY
    CHANGELIST AS   
    (SELECT
    PERSACTHST.EMPLOYEE,
    /--Added by KAM--/
    PERSACTHST.COMPANY,
    PERSACTHST.ACTION_CODE,
    PERSACTHST.REASON_01,
    PERSACTHST.DATE_STAMP,
    PERSACTHST.EFFECT_DATE,
    PERSACTHST.REASON_02,
    PREVSTAT.A_VALUE PS_A_VALUE,
    PREVSTAT.DATE_STAMP PS_HR_DATE_STAMP,
    PREVSTAT.BEG_DATE PS_HR_BEG_DATE,
    PREVSTAT.OBJ_ID PS_HR_OBJ_ID,
    PREVSTAT.SEQ_NBR PS_HR_SEQ_ID,
    NEWSTAT.A_VALUE NS_A_VALUE,
    NEWSTAT.DATE_STAMP NS_DATE_STAMP,
    NEWSTAT.BEG_DATE NS_BEG_DATE,
    NEWSTAT.NS_OBJ_ID,
    NEWSTAT.SEQ_NBR NS_SEQ_NBR
    FROM
    LAWSON.PERSACTHST PERSACTHST
                        INNER JOIN LAWSON.PREVSTAT
                       ON PERSACTHST.EMPLOYEE=PREVSTAT.EMPLOYEE
                       /--Added by KAM--/
                       AND PERSACTHST.COMPANY = PREVSTAT.COMPANY
                       INNER JOIN LAWSON.NEWSTAT
                       ON PERSACTHST.EMPLOYEE = NEWSTAT.EMPLOYEE
                      /--Added by KAM--/
                       AND PERSACTHST.COMPANY = NEWSTAT.COMPANY
                       INNER JOIN LAWSON.MAXPERSACTHST
                       ON PERSACTHST.EMPLOYEE = MAXPERSACTHST.EMPLOYEE
                      /--Added by KAM--/
                         AND PERSACTHST.COMPANY = MAXPERSACTHST.COMPANY
    WHERE
    (PERSACTHST.ACTION_CODE='LOASTATUS' OR PERSACTHST.ACTION_CODE='STATUS')
    AND NEWSTAT.A_VALUE <> PREVSTAT.A_VALUE
    AND MAXPERSACTHST.DATE_STAMP = PERSACTHST.DATE_STAMP
    PAEMPPOSENDDATE AS
    (SELECT
      PAEMPPOS.EMPLOYEE,
      PAEMPPOS.COMPANY,
      CASE
      WHEN PAEMPPOS.END_DATE = TO_DATE('1700,01,01','YYYY,MM,DD')
             THEN to_date(SYSDATE + 1,'YYYY,MM,DD')
           ELSE PAEMPPOS.END_DATE 
      END END_DATE,
      PAEMPPOS.EFFECT_DATE
      FROM LAWSON.PAEMPPOS),
    CURRFTE AS
    (SELECT
      PAEMPPOS.EMPLOYEE,
    /--Added by KAM--/
      PAEMPPOS.COMPANY,
      PAEMPPOS.FTE CURR_FTE,
      PAEMPPOS.EFFECT_DATE,
      PAEMPPOSENDDATE.END_DATE  
    FROM
    LAWSON.PAEMPPOS
    INNER JOIN LAWSON.NEWSTAT
    ON (PAEMPPOS.EMPLOYEE = NEWSTAT.EMPLOYEE)
    /--Added by KAM--/
    AND (PAEMPPOS.COMPANY = NEWSTAT.COMPANY)
    INNER JOIN LAWSON.PAEMPPOSENDDATE
    ON PAEMPPOS.EMPLOYEE = PAEMPPOSENDDATE.EMPLOYEE
    /--Added by KAM--/
    AND PAEMPPOS.COMPANY = PAEMPPOSENDDATE.COMPANY
    AND PAEMPPOS.EFFECT_DATE=PAEMPPOSENDDATE.EFFECT_DATE
    WHERE
      (PAEMPPOSENDDATE.EFFECT_DATE <= NEWSTAT.BEG_DATE AND PAEMPPOSENDDATE.END_DATE >= NEWSTAT.BEG_DATE)
    PREVFTE AS
    (SELECT
      PAEMPPOS.EMPLOYEE,
    /--Added by KAM--/
      PAEMPPOS.COMPANY,
      PAEMPPOS.FTE PREV_FTE,
    PAEMPPOSENDDATE.END_DATE 
    FROM
    LAWSON.PAEMPPOS
    INNER JOIN LAWSON.NEWSTAT
    ON (PAEMPPOS.EMPLOYEE = NEWSTAT.EMPLOYEE)
    /--Added by KAM--/
    AND (PAEMPPOS.COMPANY = NEWSTAT.EMPLOYEE)
    INNER JOIN LAWSON.PAEMPPOSENDDATE
    ON (PAEMPPOS.EMPLOYEE = PAEMPPOSENDDATE.EMPLOYEE)
    /--Added by KAM--/
    AND (PAEMPPOS.COMPANY = PAEMPPOSENDDATE.COMPANY)
    AND (PAEMPPOS.EFFECT_DATE = PAEMPPOSENDDATE.EFFECT_DATE)
    WHERE
      PAEMPPOS.EFFECT_DATE <= (NEWSTAT.BEG_DATE-1)AND  PAEMPPOSENDDATE.END_DATE >= (NEWSTAT.BEG_DATE -1)
    SELECT DISTINCT
    EMPLOYEE.EMPLOYEE,
    EMPLOYEE.DEPARTMENT,
    EMPLOYEE.PROCESS_LEVEL,
    EMPLOYEE.EMP_STATUS,
    EMPLOYEE.FIRST_NAME,
    EMPLOYEE.LAST_NAME,
    EMPLOYEE.MIDDLE_INIT,
    EMPLOYEE.POSITION,
    PAPOSITION.DESCRIPTION,
    CHANGELIST.PS_A_VALUE,
    /--Added by KAM--/
    CHANGELIST.COMPANY,
    CHANGELIST.PS_HR_DATE_STAMP,
    CHANGELIST.PS_HR_BEG_DATE,
    CHANGELIST.PS_HR_OBJ_ID,
    CHANGELIST.NS_A_VALUE,
    CHANGELIST.NS_DATE_STAMP,
    CHANGELIST.NS_OBJ_ID,
    CHANGELIST.ACTION_CODE,
    CHANGELIST.REASON_01,
    CHANGELIST.REASON_02,
    CHANGELIST.DATE_STAMP PERSACTSDATESTAMP,
    CHANGELIST.EFFECT_DATE PERSACTEFFDATE,
    DEPTCODE.R_NAME DEPTNAME,
    PRSYSTEM.R_NAME PLNAME,
    PREVFTE.PREV_FTE,
    CURRFTE.CURR_FTE,
    CHANGELIST.NS_BEG_DATE,
    PGSELECT.GROUP_NAME,
    PAEMPLOYEE.SENIOR_DATE
    FROM
    LAWSON.CHANGELIST
                      INNER JOIN LAWSON.EMPLOYEE
                     ON (EMPLOYEE.EMPLOYEE = CHANGELIST.EMPLOYEE)
    /--Added by KAM--/
                     AND (EMPLOYEE.COMPANY = CHANGELIST.COMPANY)
                     INNER JOIN LAWSON.DEPTCODE
                     ON ((EMPLOYEE.COMPANY=DEPTCODE.COMPANY)
                     AND (EMPLOYEE.PROCESS_LEVEL=DEPTCODE.PROCESS_LEVEL)
                     AND (EMPLOYEE.DEPARTMENT=DEPTCODE.DEPARTMENT))
                     INNER JOIN LAWSON.PRSYSTEM
                     ON ((EMPLOYEE.COMPANY=PRSYSTEM.COMPANY)
                     AND(EMPLOYEE.PROCESS_LEVEL=PRSYSTEM.PROCESS_LEVEL))
                     LEFT OUTER JOIN LAWSON.PREVFTE
                       ON (CHANGELIST.EMPLOYEE=PREVFTE.EMPLOYEE)
    /--Added by KAM--/                
                     AND (CHANGELIST.COMPANY=PREVFTE.COMPANY)
                     LEFT OUTER JOIN LAWSON.CURRFTE
                     ON (CHANGELIST.EMPLOYEE=CURRFTE.EMPLOYEE)
    /--Added by KAM--/                                
                     AND (CHANGELIST.COMPANY=CURRFTE.COMPANY)
                     INNER JOIN LAWSON.PGSELECT PGSELECT
                       ON ((EMPLOYEE.COMPANY=PGSELECT.COMPANY)
                     AND (EMPLOYEE.EMP_STATUS=PGSELECT.BEGIN_VALUE))
                     LEFT OUTER JOIN LAWSON.PAPOSITION
                     ON (EMPLOYEE.POSITION=PAPOSITION.POSITION)
                     AND (EMPLOYEE.COMPANY=PAPOSITION.COMPANY)
                     INNER JOIN LAWSON.PAEMPLOYEE
                     ON (CHANGELIST.EMPLOYEE=PAEMPLOYEE.EMPLOYEE)
    /--Added by KAM--/               
                    AND (CHANGELIST.COMPANY=PAEMPLOYEE.COMPANY)
    WHERE
    (PGSELECT.GROUP_NAME='G:ACTIVE' OR PGSELECT.GROUP_NAME='G:INACTIVE')
    >

    Hi Arsh,
    The error message you receive i.e.
    ORA-01830: date format picture ends before converting entire input string
    is an Oracle error.
    The following document would be helpful:
    ORA-01830:     date format picture ends before converting entire input string
    Cause:     A valid date format picture included extra data. The first part of the format picture was converted into a valid date, but the remaining data was not required.
    Action:     Check the specifications for date format pictures and correct the statement.
    Regards,
    Alpana

  • Seeking help in extracting data from partitioned table"YEARWISE".

    Hi Experts,
    I need a favour in extracting data YEARWISE like 'from 1999 to 2000.
    Table is partitioned with around 40 partitions, and data I want to extract with sign ',' separating columns.So that I can move it to application as text file directly.
    Plateform : Wind2k
    Oracle Version : 8i
    nls_date_format ...shows nothing..
    sysdate is in : dd-mm-yyyy format
    Here is my script, but so far it didn't yield anything...It looks like it is running, but I can see spool file with just 0 bytes.
    Please check the script "May be I m doing something wrong" , help me out.
    Let me also inform you that column  ENDRETTID is with datatype DATE, so I put this column for sorting.
    ===========================================================================================
    connect / as sysdba
    spool e:\dumps\frdz_fintrans_txt.log
    set heading off;
    set pagesize 0;
    set feedback off;
    set echo off;
    set pause off;
    set termout off;
    select BATCHID||','||
    PRODUKTKODE||','||
    OKODATO||','||
    SAKSBEHANDLERID||','||
    PRODDATO||','||
    KJOPSDATO||','||
    FRABINNR||','||
    POSENTRYMODE||','||
    ARSAKSKODE||','||
    BELOPVAL||','||
    BELOP||','||
    BRANSJEKODE||','||
    BRBREGNR||','||
    BINNR||','||
    POSTNR||','||
    TRANSKODE||','||
    FIRMANR||','||
    KJOPSTYPEID||','||
    KHBREGNR||','||
    SENTRALNR||','||
    REIMBURSMENTKODE||','||
    AUTORISERT||','||
    VALUTAKODE||','||
    PRECARIND||','||
    PAYMENTIND||','||
    ATMACCOUNT||','||
    POSTERMCAP||','||
    POSPINCAP||','||
    MAILTLFIND||','||
    SPESCOND||','||
    PROVISJON||','||
    LANDKODE||','||
    DATOID||','||
    CHIDMETHOD||','||
    ENDRETTID||','||
    TERMINALID||','||
    BRAND||','||
    KURSPASLAG||','||
    MCGEBYR||','||
    ACQBIN||','||
    LAND||','||
    CARDTYPE||','||
    DEBCRE||','||
    DOMAIN||','||
    CHIP||','||
    REGION from vdv.fintrans WHERE ENDRETTID >= to_date('01-01-1999','DD-MM-YYYY') and ENDRETTID <=to_date('01-01-2000','DD-MM-YYYY');
    spool off
    exit

    No Sir, no indexing on that column. Please help me with some easiest way to extract the data Yearwise.
    COLUMN_NAME    
    COLUMN_POSITION TABLE_NAME
    BATCHID                      
    1 FINTRANS
    KHBREGNR                     
    1 FINTRANS
    PRODDATO                     
    1 FINTRANS
    SQL>
    ======================
    Description of the table is as:
    SQL> desc vdv.fintrans;
    Navn                                      Null?    Type
    BATCHID                                   NOT NULL NUMBER
    PRODUKTKODE                                        VARCHAR2(1)
    OKODATO                                            NUMBER(8)
    SAKSBEHANDLERID                                    VARCHAR2(8)
    PRODDATO                                           NUMBER(8)
    KJOPSDATO                                          NUMBER(8)
    FRABINNR                                           VARCHAR2(19)
    POSENTRYMODE                                       VARCHAR2(2)
    ARSAKSKODE                                         NUMBER(2)
    BELOPVAL                                           NUMBER(14)
    BELOP                                              NUMBER(14)
    BRANSJEKODE                                        NUMBER(4)
    BRBREGNR                                           NUMBER(4)
    BINNR                                              NUMBER
    POSTNR                                             NUMBER(4)
    TRANSKODE                                          NUMBER(2)
    FIRMANR                                            NUMBER(11)
    KJOPSTYPEID                                        NUMBER(2)
    KHBREGNR                                           NUMBER(4)
    SENTRALNR                                          NUMBER(3)
    REIMBURSMENTKODE                                   VARCHAR2(2)
    AUTORISERT                                         NUMBER
    VALUTAKODE                                         NUMBER(3)
    PRECARIND                                          VARCHAR2(1)
    PAYMENTIND                                         VARCHAR2(1)
    ATMACCOUNT                                         VARCHAR2(1)
    POSTERMCAP                                         VARCHAR2(1)
    POSPINCAP                                          VARCHAR2(1)
    MAILTLFIND                                         VARCHAR2(1)
    SPESCOND                                           VARCHAR2(2)
    PROVISJON                                          NUMBER(10,2)
    LANDKODE                                           VARCHAR2(2)
    DATOID                                             NUMBER(8)
    CHIDMETHOD                                         VARCHAR2(1)
    ENDRETTID                                          DATE
    TERMINALID                                         VARCHAR2(8)
    BRAND                                              VARCHAR2(1)
    KURSPASLAG                                         NUMBER(14)
    MCGEBYR                                            NUMBER(14)
    ACQBIN                                             NUMBER(6)
    LAND                                               VARCHAR2(2)
    CARDTYPE                                           VARCHAR2(2)
    DEBCRE                                             VARCHAR2(1)
    DOMAIN                                             VARCHAR2(1)
    CHIP                                               VARCHAR2(1)
    REGION                                             NUMBER(1)
    =========
    Tried also to create new table for a month...but it is just going on without any table creation or data insertion...just hung kind of thing
    CREATE TABLE vdv.frdz AS (SELECT * FROM vdv.fintrans WHERE ENDRETTID >=to_date('01-01-1999','DD-MM-YYYY') AND ENDRETTID <=to_date('01-02-1999','DD-MM-YYYY'));

  • Pls help with a program

    I'm making a quiz, and i store the questions in a textfile. The user can choose from 3 quizes, either Plate Tectonics, Rivers or Rocks. I managed to call the questions from Java. Each quiz has a set of 10 questions. In the code below i only included the answers to the Plate Tectonics Quiz, which i stored in an array. What i'm having problem with is, that its not working correctly, since it is displaying, after answering all the questions correctly that i have answered 0 questions from 1 question. First of all it should say out of 10 questions because i have 10 questions, and its not really working because even if i answer them all corrctly it still says 0 out of 1 question. Can someone pls help me find the error? Thanks a lot.
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.util.*;
    import java.io.*;
    import java.util.Scanner;
    import java.util.Arrays;
    public class GeographyQuiz extends JFrame implements ActionListener {
      private static final int FRAME_WIDTH = 140;
      private static final int FRAME_HEIGHT = 160;
      private static final int FRAME_X_ORIGIN = 70;
      private static final int FRAME_Y_ORIGIN = 50;
       AnswerStore answerStore = new AnswerStore();
      public static void main (String[] args) {
        JFrame jFrame;
        jFrame = new JFrame();
        JOptionPane.showMessageDialog(jFrame, "This is a Geography Quiz");
        JOptionPane.showMessageDialog(null, "Good Luck");
        char choice;
        int i, choice1, Password;
        String yourChoice, passString;
        passString = JOptionPane.showInputDialog("Enter the Password");
        //Password = passString.nextInt();
        Password = Integer.parseInt(passString);
        if (Password == 123) {
         JOptionPane.showMessageDialog(null, "Valid. You typed the right password. Now choose from the following menu");
         GeographyQuiz frame = new GeographyQuiz();
          frame.setVisible(true);
        } else {
          JOptionPane.showMessageDialog(null, "Invalid Password. Try Again");
      public GeographyQuiz() {
        Container contentPane;
        JButton button1, button2, button3, button4, button5;
        setSize (FRAME_WIDTH, FRAME_HEIGHT);
        setTitle("Geography Quiz");
        setLocation(FRAME_X_ORIGIN, FRAME_Y_ORIGIN);
        contentPane = getContentPane();
        contentPane.setBackground(Color.pink);
        contentPane.setLayout(new FlowLayout());
        button1 = new JButton("Plate Tectonics");
        button2 = new JButton("Rivers");
        button3 = new JButton("Rocks");
        button4 = new JButton("Quit");
        contentPane.add(button1);
        contentPane.add(button2);
        contentPane.add(button3);
        contentPane.add(button4);
        button1.addActionListener(this);
        button1.setActionCommand("b1");
        button2.addActionListener(this);
        button2.setActionCommand("b2");
        button3.addActionListener(this);
        button3.setActionCommand("b3");
        button4.addActionListener(this);
        button4.setActionCommand("b4");
        setDefaultCloseOperation(EXIT_ON_CLOSE);
       public void actionPerformed(ActionEvent e) {
    String ac = e.getActionCommand();
            String[] questions = null;
             try {
            if (ac.equals("b1")) {
                questions = readFile("plate_tectonics.txt");
            } else if(ac.equals("b2")) {
                questions = readFile("rivers.txt");
            } else if(ac.equals("b3")) {
                questions = readFile("rocks.txt");
            } else if (ac.equals("b4")) {
                System.exit(0);
            askQuestions(questions);
         catch (java.io.FileNotFoundException f)
            JOptionPane.showMessageDialog(null, "File not found.");
        private String[] readFile(String path)throws FileNotFoundException {
            Scanner s = null;
            StringBuilder sb = new StringBuilder();
            String separator = "\n";
            try {
                s = new Scanner(new BufferedReader(new FileReader(path)));
                s.useDelimiter(",\\s*");
                while (s.hasNext()) {
                   JOptionPane.showInputDialog(null,s.nextLine());
            finally {
                if (s != null)
                    s.close();
            return sb.toString().split("\\s");
        private void askQuestions(String[] questions) {
            int count = 0;
            for(int j = 10; j < questions.length; j++) {
                 String input = JOptionPane.showInputDialog(null, questions[j]);
                 // Use reference to AnswerStore instance to access data in it.
                 if(answerStore.answer[j].equals(input))
                 count++;
            JOptionPane.showMessageDialog(null, "You answered " + count +
                                          " out of " + questions.length +
                                          " questions correctly.");
    class AnswerStore  {
    String[] answer = {
            "Hellenic", "constructive", "100km", "Italy", "Wegner",
            "constructive", "100km", "Italy", "destroyed", "Meditteranean"
    }Edited by: saytri on Dec 23, 2007 2:07 AM
    Edited by: saytri on Dec 23, 2007 2:29 AM

    stripped to bare bones, it works OK for me
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    class GeographyQuiz extends JFrame implements ActionListener {
      AnswerStore answerStore = new AnswerStore();
      public static void main (String[] args) {
        JOptionPane.showMessageDialog(null, "This is a Geography Quiz\n\nGood Luck");
        char choice;
        int i, choice1, Password;
        String yourChoice;
        GeographyQuiz frame = new GeographyQuiz();
        frame.setVisible(true);
      public GeographyQuiz() {
        Container contentPane;
        JButton button1;
        setSize (140, 160);
        setTitle("Geography Quiz");
        setLocationRelativeTo(null);
        contentPane = getContentPane();
        contentPane.setBackground(Color.pink);
        contentPane.setLayout(new FlowLayout());
        button1 = new JButton("Plate Tectonics");
        contentPane.add(button1);
        button1.addActionListener(this);
        button1.setActionCommand("b1");
        setDefaultCloseOperation(EXIT_ON_CLOSE);
      public void actionPerformed(ActionEvent e) {
        String ac = e.getActionCommand();
        String[] questions = null;
        if (ac.equals("b1")) {
          questions = new String[]{"what is 1+1","what is 2+2"};
          askQuestions(questions);
      private void askQuestions(String[] questions) {
          int count = 0;
          for(int j = 0; j < questions.length; j++) {
            String input = JOptionPane.showInputDialog(null, questions[j]);
            if(answerStore.answer[j].equals(input)) count++;
          JOptionPane.showMessageDialog(null, "You answered " + count +
                                        " out of " + questions.length +
                                        " questions correctly.");
    class AnswerStore  {
    String[] answer = {"2", "4"};
    }either the problem is in the file, or the posted code is not what you're using

  • Problem with extract data from R/3 to BW

    I want extract data from R/3 system.the problem is when I run the infopackage,I can see the status is yellow In the Monitor and the data can't extract to BW.but in the source system,the job of extracting data has been finished.
    (use the Tcode: WE02)the Outbound IDocs and Inbound IDocs are OK,but in the BW system ,I canu2019t see the Inbound IDocs.
    In the source system use Tcode: SM50,I can see the process SAPLQOWK is running for a long time and run out system memory.
    use Tcode : SM58, I execute LUW, the data can transfer to BW system,but the report SAPLQOWK is not stop.
    it would be stopped by canceling the process manually in operating system or it run out time.
    why can't i extract data from R/3 system successfully ?
    why the process SAPLQOWK can't finish?
    how can i do?

    Hi,
    I hope the note 527481 would help you to sort out this problem.
    Regards,
    Anil Kumar Sharma .P

  • Need help with saving data and keeping table history for one BP

    Hi all
    I need help with this one ,
    Scenario:
    When adding a new vendor on the system the vendor is suppose to have a tax clearance certificate and it has an expiry date, so after the certificate has expired a new one is submitted by the vendor.
    So i need to know how to have SBO fullfil this requirement ?
    Hope it's clear .
    Thanks
    Bongani

    Hi
    I don't have a problem with the query that I know I've got to write , the problem is saving the tax clearance certificate and along side it , its the expiry date.
    I'm using South African localization.
    Thanks

  • Help with a Date variable

    I'm creating a jscript to automatically rename a file the current days date, but i can't figure out how to get it to put a zero in front of days/months that are single digits. Can anyone help me real quick? Heres the code i already have, pay no attention to the "dh" part, it has to be there:
    var todayFileName = "dh" +
    today.getFullYear() + "" +
    today.getMonth() + "" +
    (today.getDate()+1); + " " +

    This little javascript function should help.
    Note that it is only meant to work with valid dates. Putting in a -7 for the parameter will result in something not so nice :-)
    function twoDigitNo(no){
        return  (no < 10) ? "0" + no : no;
      }Cheers,
    evnafets

  • Help with calender dates

    Hello every one
    I have a table with calender dates and there is a indicator which says if it is a working day or an holiday. Is there a way I can write a procedure that will help me fill that indicator column based on the calender dates.
    My table looks something like this
    date indicator
    01/01/2011 Holiday
    01/02/2011 working day
    01/03/2011 working day
    12/31/2011 working day

    Good Friday or Easter Monday as a holiday I can't help you with that.
    here is easter both julian and gregarian
    WITH years AS (    SELECT 1989 + LEVEL yr
                         FROM DUAL
                   CONNECT BY LEVEL <= 30)
    SELECT TO_CHAR (TO_DATE (day || ' ' || month || ' ' || yr, 'DD MM YYYY'),
                    'DD MON YYYY')
              easter_day_julian,
           TO_CHAR (
              TO_DATE (day || ' ' || month || ' ' || yr, 'DD MM YYYY') + 13,
              'DD MON YYYY')
              easter_day_gregorian
      FROM (SELECT yr,
                   a,
                   b,
                   c,
                   d,
                   e,
                   FLOOR ( (d + e + 114) / 31) month,
                   MOD (d + e + 114, 31) + 1 day
              FROM (SELECT yr,
                           a,
                           b,
                           c,
                           d,
                           MOD ( ( (2 * a) + (4 * b) - d + 34), 7) e
                      FROM (SELECT yr,
                                   a,
                                   b,
                                   c,
                                   MOD ( (19 * c + 15), 30) d
                              FROM (SELECT yr,
                                           MOD (yr, 4) a,
                                           MOD (yr, 7) b,
                                           MOD (yr, 19) c
                                      FROM years))))Edited by: pollywog on Nov 24, 2010 2:06 PM

  • Need help with enhanced data source in Production system

    Hello Gurus,
    1.                  I enhanced a datasource in BW and populated the field using customer exit using CMOD function. In Dev system, i dont have much data, so I deleted the whole data and did full load.
    what shud I do in Production side, so that Delta wudnt be affected??since in production, we have millions of records, we wont do full load., what is the best way to populate the field in production after transporting the datasource to production without disturbing delta's, to reflect the new field for previous years data???
    2.  can we put 0customer and 0material in the same dimension?? how its going to affect the performance?
    Thanks in advance.,
    Best Regards,
    Pavan

    Hi,
    Please see this
    1.
    see this thread
    populated the new field with historic data
    2. can we put 0customer and 0material in the same dimension?? how its going to affect the performance?
    Its better not to use them in a single dimension  because one customer and take more than one material so if you have 100 customer and 1000 materials  this combination will generate a large number of records. Its always better to keep characteristic which are having 1:N relation ship in one dimensional in you  case customer and material will have an M:N type of relationship.which will result in slow performance.
    Regards,
    Ravi

  • Need help with Rollback data if there is error in Data load

    Hi All,
    We are trying to load data to Oracle 11g database. We want a trigger, procedure or something like that to rollback the data if there are errors in load. Is it possible to do rollback after all the records has been parsed ? So if we try to load 100 records and if there are 30 records with error, we want to rollback after all the 100 records are parsed.
    Please advice.

    >
    Thanks for the suggestion. I'll try that option. So currently we are only loading data that is validated and erroneous records are rejected using trigger. So we don't get any invalid data in table. But Now users are saying that all the records should be rejected if there is even one error in the data load.
    >
    I generally use a much simpler solution for such multi-stage ETL processes.
    Each table has a IS_VALID column that defaults to 'N'. Each step of the process only pulls data with the flag set to 'Y'.
    That allows me to leave data in the table but guarantee that it won't be processed by subsequent stages. Since most queries that move data from one stage to another ultimately have to read table rows (i.e. they can't just use indexes) it is not a performance issue to add a predicate such as "'AND IS_VALID = 'Y'" to the query that accesses data.
    1. add new unvalidated data - automatically flagged an invalid by default of 'N" on IS_VALID column
    2. run audit step #1 - capture the primary key/rowid of any row failing the audit.
    3. run audit steps #2 through #n - capture error row ids
    4. Final step - update the data setting IS_VALID to 'Y' only if a row passes ALL audits: that is, only if there are NO fatal errors for that row captured in the error table.
    That process also allows me to capture every single problem that any row has so that I can produce reports for the business users that show everything that is wrong with the data. There are some problems that the business wan't to ignore, others that can be fixed in the staging tables then reprocessed and others that are rejected since they must be fixed in the source system and that can take several days.
    For data that can be fixed in the staging tables the data is fixed and then the audit is rerun which will set the IS_VALID flag to 'Y' allowing those 'fixed' rows to be included in the data that feeds the next processing stage.

  • Need help with extracting sales data

    Hi all,
    We want to get a list of net sales (invoice minus credit notes) per customer by Item Group. This would look like:
    Customer Code | Customer Name | Item GroupA | Item GroupB | Item GroupC etc..
    The data appears to be in the Sales Analysis Report if we select the Items tab and use "Group Display" and "Total By Customer". However the format of that is different to the above.
    Can anyone suggest either:
    - how to do the same thing via query
    - how to best convert the standard output into the above format (perhaps some Excel trickery?)
    Thanks in advance,
    Raj

    Hi Raj,
    Try this query. You change the tables as per your needs.
    select OCRD.CardName ,
    case when OITB.ItmsGrpCod  = 103 then SUM(doctotal) else 0 end as 'Amplifier (AMP)',
    CASE when OITB.ItmsGrpCod  = 104 then SUM(doctotal) else 0 end as 'Audio Tech (AUT)'
    from ocrd inner join oinv on ocrd.cardcode = oinv.cardcode 
    inner join nnm1 on oinv.series = nnm1.series 
    inner join inv1 on oinv.docentry = inv1.docentry 
    inner join OITM on OITM.ItemCode = INV1.ItemCode
    inner join OITB  on OITM.ItmsGrpCod = OITB.ItmsGrpCod
    where oinv.docdate >= CONVERT(DATETIME, '4/1/2011', 102) 
    and oinv.docdate <= convert(datetime,'3/31/2012',102) 
    and ocrd.cardcode = 'CA0163'
    group by OCRD.CardName , OITB.ItmsGrpCod 
    Union 
    select OCRD.CardName ,
    case when OITB.ItmsGrpCod  = 103 then SUM(-doctotal) else 0 end as 'Amplifier (AMP)',
    CASE when OITB.ItmsGrpCod  = 104 then SUM(-doctotal) else 0 end as 'Audio Tech (AUT)'
    from ocrd inner join orin on ocrd.cardcode = orin.cardcode 
    inner join nnm1 on orin.series = nnm1.series 
    inner join rin1 on orin.docentry = rin1.docentry 
    inner join OITM on OITM.ItemCode = RIN1.ItemCode
    inner join OITB  on OITM.ItmsGrpCod = OITB.ItmsGrpCod
    where orin.docdate >= CONVERT(DATETIME, '4/1/2011', 102) 
    and orin.docdate <= convert(datetime,'3/31/2012',102) 
    and ocrd.cardcode = 'CA0163'
    group by ocrd.CardName , oitb.ItmsGrpCod
    order by 1,2
    Thanks
    Malhaar

  • PLS HELP WITH POSITIVE PAY INTERFACE

    Please help me with the following:
    1)  What is Positive Pay?
    2) How do we configure Positive Pay which will include an interface to the 3 different bank accounts. It will send Check Number, Amount, Date, and Payee to the banks. What configuration is supposed to be done from a Functional FI-AP Consultant's side in AP.  All the house banks and other bank related information is all configured. Please provide detailed answer on this.
    THanks
    Laks

    Hi,
    Possitive pay file is used for check extraction. Through FCHX we can create a file of checks belongs to paying company code. Here the data is sorted according to accounting number and check number. With the using of this we can know the encashed checks, individual payment methods, amounts, void reason codes etc.
    Here we can change the format according to our Bankers requirement.
    Thanks & Regards
    Sunitha.

  • Help with extraction from 0CO_OM_CCA_9

    Hello Experts,
    I need your help urgently.
    I’am doing CO extraction with the 0CO_OM_CCA_9 DataSource.
    I have made one append to the extraction structure and filled the fields in function module EXIT_SAPLRSAP_001.
    Everything worked fine till this moment.
    My problem is that I can’t retrieve data only in productive system. In development and Quality systems the append fields are filled.
    I have transported everything one more time, but the problem remained.
    I have Go Live next Monday, and I would appreciate your help on this.
    Best Regards,
    João Arvanas

    Hi Jaya,
    The problem is solved.
    Thank you for your suggestion.
    The problem was with the Package in which the Exit was included.
    I have awarded points.
    Best regards.

Maybe you are looking for