Determining angle between current and last position; 2D

Hi,
I have a player on a JPanel from a bird's eye view. I have to determine the angle (0 - 360) of the player's move:
                      0 or 360
                         |
                         |
                         |
                         |
270--------------------Player--------------------90
                         |
                         |
                         |
                         |
                        180The top of the JPanel corresponds to 0 or 360 degree, the right side to 90 degree etc.
I have to determine the angle between the current and the last (x, y) coordinates of the player. The player is being moved by mouse clicks.
I don't know where to start to implement this... and how I can calculate the angle between these 2 positions (which I store in an Ellipse2D ArrayList).
Thanks for your help!

Multiply them by -1. Do you understand how degrees
work? Degrees go counterclockwise. So 0 degrees
should be on the right, and 90 degrees should be
straight up.Oh... I didn't know that degrees in Java go counterclockwise and start on the right. Sorry. Is there a way to tell Java to start "at the top" and go clockwise? Or is the solution to change the formula? Thanks! :)

Similar Messages

  • Current and Last PO Calculation

    Hello All,
    0PUR_C01 is my InfoProvider. I also have data in 0PUR_O01, which is an DSO.
    I need to build a report giving Current and Last PO details for a Material (independent of vendor).
    The user will input only single date. The system should check which is the latest and latest-1 PO using that input date.
    I am looking for a customer exit which can solve this.
    Thanks,
    Mainak

    Hi Mainak,
    I do not have the exact code as per your requirements.This is sample code for Quantity field with the document date field ( date should be restricted between system date and system date+112 days).
    WHEN 'ZPRDATE1'.
    IF i_step = 2.
    READ TABLE I_T_VAR_RANGE INTO LOC_VAR_RANGE
    WITH KEY VNAM = 'ZPRDATE'.
    v_date1 = LOC_VAR_RANGE-LOW.
    ddate1 = sy-datum.
    l_s_range-sign = 'I'.
    *l_s_range-opt = 'EQ'.
    l_s_range-opt = 'BT'.
    l_s_range-low = ddate1.
    l_s_range-high = sy-datum + 112. (Check syntax)
    Append l_s_range to E_T_RANGE.
    ENDIF.
    If  your variable  want to be defined as "Ready for Input" ?
    pls refer this.
    The RSR00001 enhancement ("BW: Enhancements for global variables in reporting") is called repeatedly while the report is being executed. In this case, the I_STEP parameter specifies when the enhancement is being called.
    The following values are valid for I_STEP:
    I_STEP = 1
    Call directly before the variable is entered
    I_STEP = 2
    Call directly after the variable is entered. This step is activated only if the same variable could not be filled for I_STEP = 1 and it is not ready for input.
    I_STEP = 3
    In this call, you can check the values of the variables. Activating an exception (RAISE) causes the variable screen to appear again. I_STEP = 2 is also then executed once more.
    I_STEP = 0
    The enhancement is not called from the variable screen. The call can come from the authorization check or from the monitor.
    Source : Note 492504 - Dependent customer exit-type variables
    I hope this might helps you a bit,
    Regards
    CSM Reddy

  • Frm-50004: day must be between 1 and last of month.

    frm-50004: day must be between 1 and last of month.
    hi dear all,
    I HAVE A TEXTITEM OF DATATYPE DATE. ITS FORMAT MASK IS 'HH24-MI-SS AM' BUT
    WHEN I TRY TO INSERT IT GIVES THE FOLLOWING ERROR:
    FRM-50004: Day must be between 1 and last of month.
    thanks
    Muhammad Nadeem
    Mardan (Pakistan)
    [email protected]

    I don't think you are getting that error message from that date item. Oracle defaults the month to current month, day to 01, and year to current year when they aren't entered in a date.
    However, you cannot use 'HH24' with the 'AM' meridian indicator, so that format mask is illegal, and SHOULD generate a different error message.
    And last, if you want Forms to carry the time in a date field, you MUST set the datatype to datetime.

  • Day must be between 1 and last day of month

    Hi
    I have a master detail form for overtime entries.
    Master Block contain emp_no,name,month etc.
    Detail block contain a date field ,,from time, to time etc
    when i enter the date in detail block it defaults the month from Server date and i am getting the error "Day must be between 1 and last day of ...."
    The form is going to reside on server so i cant go for changing system date for that.
    THe work around i am trying is i have created a dummy item in detail block for Date(dd) entry and populating my original date field on the basis of it.
    so that i can get rid of last day validation of month.The datatype of dummy item is char
    my code is
    c_day varchar(2);
    c_month varchar(2);
    c_year varchar(4);
    d_date varchar(8);
    begin
    c_day := :DETAIL.dummy;
    c_month := to_char(:MASTER.month, 'mm');
    c_year := to_char(:master.month, 'yyyy');
    d_date := c_day||c_month||c_year;
    :DETAIL.ot_date := to_date(d_date,'ddmmyyyy');
    end;
    I am using post change trigger on my dummy item but i am getting ORA-01840 for that.I have tried several ways but it is giving different type of date errors for that.
    Any help is highly appreciated

    Dear try this
    SELECT RUN_NUM, CV AS MONTH_DATE
    FROM
    SELECT ROWNUM AS RUN_NUM,TO_DATE('01-' || 'SEP' || '-' || 2007 ,'DD/MM/YYYY')+ (ROWNUM-1) CV
    FROM
    (SELECT 1 FROM DUAL GROUP BY CUBE (1,1,1,1,1)) A
    WHERE TO_CHAR(CV,'MON-YYYY') = 'SEP-2007'

  • Error: ORA-01847: day of month must be between 1 and last day of month

    Hi,
    I am getting this ORA-01847: day of month must be between 1 and last day of month type of error but I have checked my data all are correct.
    I am inserting the data in the merge query. It is giving the above error.
    but when i insert the data like that
    insert into dt(start_date) select TO_DATE (tariff_start_date, 'DD/MM/RRRR') from ext_zpp0a871;
    It does not give any error.
    Please find the below code
    DECLARE
    l_sv_error_msg VARCHAR2 (1000);
    BEGIN
    FOR i IN (SELECT condition_type, sales_org, division_channel, division,
    price_list, ean_upc, amount, unit_of_measure1,
    tariff_start_date, tariff_end_date
    FROM ext_zpp0a871--This is external table
    WHERE condition_type = 'ZPP0' AND ROWNUM < 200)
    LOOP
    BEGIN
    MERGE INTO sap_tariff st
    USING (SELECT i.price_list pl, i.ean_upc upc,
    TO_DATE (i.tariff_start_date, 'DD/MM/RRRR') tsd,
    TO_DATE (i.tariff_end_date, 'DD/MM/RRRR') ted
    FROM DUAL) du
    ON (st.prod_ean_cuni = du.upc
    AND st.pricelist = du.pl
    AND st.tariff_start_date = du.tsd
    AND st.tariff_end_date = du.ted)
    WHEN MATCHED THEN
    UPDATE
    SET st.condition_type = i.condition_type,
    st.sales_org = i.sales_org,
    st.division_channel = i.division_channel,
    st.division = i.division,
    st.amount =
    TO_NUMBER (REPLACE (REPLACE (i.amount, '.', NULL),
    st.uom = i.unit_of_measure1
    WHEN NOT MATCHED THEN
    INSERT (condition_type, sales_org, division_channel, division,
    pricelist, prod_ean_cuni, amount, uom,
    tariff_start_date, tariff_end_date)
    VALUES (i.condition_type, i.sales_org, i.division_channel,
    i.division, i.price_list, i.ean_upc,
    TO_NUMBER (REPLACE (REPLACE (i.amount, '.', NULL),
    i.unit_of_measure1,
    TO_DATE (i.tariff_start_date, 'DD/MM/RRRR'),
    TO_DATE (i.tariff_end_date, 'DD/MM/RRRR'));
    /*INSERT INTO sap_tariff
    (condition_type, sales_org, division_channel,
    division, pricelist, prod_ean_cuni,
    amount,
    uom,
    tariff_start_date,
    tariff_end_date
    VALUES (i.condition_type, i.sales_org, i.division_channel,
    i.division, i.price_list, i.ean_upc,
    TO_NUMBER (REPLACE (REPLACE (i.amount, '.', NULL),
    i.unit_of_measure1,
    TO_DATE (i.tariff_start_date, 'DD/MM/RRRR'),
    TO_DATE (i.tariff_end_date, 'DD/MM/RRRR')
    EXCEPTION
    WHEN DUP_VAL_ON_INDEX
    THEN
    UPDATE sap_tariff
    SET condition_type = i.condition_type,
    sales_org = i.sales_org,
    division_channel = i.division_channel,
    division = i.division,
    amount =
    TO_NUMBER (REPLACE (REPLACE (i.amount, '.', NULL),
    uom = i.unit_of_measure1;
    WHEN OTHERS
    THEN
    l_sv_error_msg := SQLERRM (SQLCODE);
    INSERT INTO sap_tariff_log
    (date_of_load, condition_type, sales_org,
    division_channel, division, price_list,
    prod_ean_cuni, amount, uom,
    tariff_start_date, tariff_end_date,
    rejection_reason
    VALUES (SYSDATE, i.condition_type, i.sales_org,
    i.division_channel, i.division, i.price_list,
    i.ean_upc, i.amount, i.unit_of_measure1,
    i.tariff_start_date, i.tariff_end_date,
    l_sv_error_msg
    END;
    END LOOP;
    COMMIT;
    EXCEPTION
    WHEN OTHERS
    THEN
    l_sv_error_msg := SQLERRM (SQLCODE);
    neo_pro_log ('Others Error', l_sv_error_msg);
    END;

    user13400510 wrote:
    but when i insert the data like that
    insert into dt(start_date) select TO_DATE (tariff_start_date, 'DD/MM/RRRR') from ext_zpp0a871;
    It does not give any error.Maybe the error is on tariff_end_date instead of tariff_start_date ?
    What are the datatypes of tariff_start_date and tariff_end_date ? If they are already dates, and you to_date them (and depending on what your nls_date_xxxxx params are) you can have such errors :SQL> sho parameter nls_date_format
    NAME_COL_PLUS_SHOW_PARAM                 TYPE        VALUE_COL_PLUS_SHOW_PARAM
    nls_date_format                          string      DD/MM/YYYY
    SQL> select to_date(sysdate,'Day dd Mon RRRR') from dual;
    select to_date(sysdate,'Day dd Mon RRRR') from dual
    ERROR at line 1:
    ORA-01846: not a valid day of the week
    SQL> select to_date(sysdate,'hh24:mi:ss dd/mm/rrrr') from dual;
    select to_date(sysdate,'hh24:mi:ss dd/mm/rrrr') from dual
    ERROR at line 1:
    ORA-01850: hour must be between 0 and 23

  • ORA-01847: day of month must be between 1 and last day of month error

    Hi All
    When i run the following code i'm getting the error:ORA-01847: day of month must be between 1 and last day of month error
    SELECT t2.owner_cat,
    t1.owner_id,
    stock_id,
    Sum(received_amount) received_amount,
    Sum(curr_amount) curr_amount,
    Sum(used_amount) used_amount,
    To_char(Add_months(date_work,6),'YYYY') date_work
    FROM (SELECT owner_id_to owner_id,
    stock_id_to stock_id,
    Sum(full_amount) received_amount,
    0 curr_amount,
    0 used_amount,
    To_char(0) date_work
    FROM dw_wms_mat_transfer
    WHERE master_code_id IN ('8664','8665')
    GROUP BY owner_id_to,
    stock_id_to
    UNION ALL
    SELECT owner_id,
    stock_id,
    0 received_amount,
    Sum(curr_amount) curr_amount,
    0 used_amount,
    To_char(0) date_work
    FROM dw_wms_mat_inv
    WHERE master_code_id IN ('8664','8665')
    GROUP BY owner_id,
    stock_id
    UNION ALL
    SELECT t2.owner_id,
    t1.stock_id,
    0 received_amt,
    0 curr_amt,
    Sum(amount) used_amt,
    To_char(Add_months(date_work,6),'YYYY') date_work
    FROM dw_wms_wo_mat_dc t1,
    (SELECT owner_id,
    stock_id
    FROM dw_wms_mat_inv
    WHERE master_code_id IN ('8664','8665')
    GROUP BY owner_id,
    stock_id) t2
    WHERE t1.stock_id = t2.stock_id
    GROUP BY t2.owner_id,
    t1.stock_id,
    To_char(Add_months(date_work,6),'YYYY')) t1,
    dw_wms_setup_owner t2
    WHERE t1.owner_id = t2.owner_id
    GROUP BY t2.owner_cat,
    t1.owner_id,
    stock_id,
    To_char(Add_months(date_work,6),'YYYY')
    But when i just run the inner query:
    (SELECT owner_id_to owner_id,
    stock_id_to stock_id,
    Sum(full_amount) received_amount,
    0 curr_amount,
    0 used_amount,
    To_char(0) date_work
    FROM dw_wms_mat_transfer
    WHERE master_code_id IN ('8664','8665')
    GROUP BY owner_id_to,
    stock_id_to
    UNION ALL
    SELECT owner_id,
    stock_id,
    0 received_amount,
    Sum(curr_amount) curr_amount,
    0 used_amount,
    To_char(0) date_work
    FROM dw_wms_mat_inv
    WHERE master_code_id IN ('8664','8665')
    GROUP BY owner_id,
    stock_id
    UNION ALL
    SELECT t2.owner_id,
    t1.stock_id,
    0 received_amt,
    0 curr_amt,
    Sum(amount) used_amt,
    To_char(Add_months(date_work,6),'YYYY') date_work
    FROM dw_wms_wo_mat_dc t1,
    (SELECT owner_id,
    stock_id
    FROM dw_wms_mat_inv
    WHERE master_code_id IN ('8664','8665')
    GROUP BY owner_id,
    stock_id) t2
    WHERE t1.stock_id = t2.stock_id
    GROUP BY t2.owner_id,
    t1.stock_id,
    To_char(Add_months(date_work,6),'YYYY'))
    I'm not getting that error, any help please?

    Hi,
    Like Anuraq already explained, you need to keep in mind that when you apply a to_char, you've turned your DATE datatype into a STRING and by doing that you've lost the ability to use the add_months function again in your outer query.
    Using a simplified example, extracted from your example:
    MHO%xe> select to_char(add_months(date_work, 6), 'yyyy') date_work
      2  from ( select to_char(0) date_work
      3         from dual
      4         union all
      5         select to_char(0) date_work
      6         from dual
      7         union all
      8         select to_char(add_months(sysdate, 6), 'yyyy') date_work
      9         from dual
    10       );
    select to_char(add_months(date_work, 6), 'yyyy') date_work
    FOUT in regel 1:
    .ORA-01847: day of month must be between 1 and last day of monthHowever, you should either do something like:
    MHO%xe> select nvl(to_char(add_months(date_work, 12), 'yyyy'), '0') date_work
      2  from ( select to_date(null) date_work
      3         from dual
      4         union all
      5         select to_date(null) date_work
      6         from dual
      7         union all
      8         select sysdate date_work
      9         from dual
    10       );
    DATE
    0
    0
    2010or (less clear, more confusing):
    MHO%xe> select nvl(to_char(add_months(date_work, 6), 'yyyy'), '0') date_work
      2  from ( select to_date(null) date_work
      3         from dual
      4         union all
      5         select to_date(null) date_work
      6         from dual
      7         union all
      8         select add_months(sysdate, 6) date_work
      9         from dual
    10       );
    DATE
    0
    0
    2010It's not clear to me why you're using add_months twice (inner + outer query) in your original example.
    As you can see you can get the same results using it only once in your outer query.

  • Ora-01847 day of month between 1 and last date of month coming in my query

    i m executing simple query but it is not working plz do help
    select *
    from sgvf_tree_nodes_vw
    where to_date(node_attr9_val, 'dd/mm/yyyy') between
    to_date('01/01/2010', 'dd/mm/yyyy') and
    to_date('31/12/2010', 'dd/mm/yyyy')
    gives : Ora-01847 day of month should be between 1 and last date of month

    Hi,
    Check the date format's once
    SQL> drop table demo;
    Table dropped.
    SQL> create table demo(val number, todate varchar2(12));
    Table created.
    SQL> insert into demo values(1,'04/11/2008');
    1 row created.
    SQL> commit;
    Commit complete.
    SQL> select * from demo;
           VAL TODATE
             1 04/11/2008
    SQL> select sysdate from dual;
    SYSDATE
    03-FEB-11
    SQL> insert into demo values(1,'04/11/2010');
    1 row created.
    SQL> commit;
    Commit complete.
    SQL> select *
      2  from demo
      3  where to_date(todate,'dd/mm/yyyy') between to_date('01/01/2010', 'dd/mm/yyyy') and to_date('31/12/2010', 'dd/m
    m/yyyy');
           VAL TODATE
             1 04/11/2010- Pavan Kumar N

  • What is the diff in term of fastness and performance between retina and last mbp version in percentage ?

    What is the diff in term of fastness and performance between retina and last mbp version in PERCENTAGE ?
    Ty to not give links i want an answer here and now by someone who knows what hes talking about.

    But old mbp is not available with ssd you have to buy the option right ?
    Anyway, outside reboot speed is there a speed difference between retina and old version in term of general processing  ?
    I have a 2009 MBP that originally came with a SATA drive. Recently, I swapped drives; now, it has 512GB SSD. In other words, you can easily increase the speed of a standard MBP. There is going to be an increase in general processing with the Retina MBPs, but the significance depends on the application. For example, booting Photoshop used to take just over 30 seconds with a SATA drive; with an SSD, it's just under 10 seconds. But controlling for the SATA vs SSD, the differences are smaller and incremental.
    Ok you speak about a diff with the retina in term of better graphics when zooming but will this advantage be relevant also on my external  giant monitors ?
    I can't answer that, so I'll leave that to someone with more expertise in this area.

  • BPM - Do we need receiver determination step between trans and sync send?

    Hi Gurus,
    I have a 1:1 transformation step followed by a sync send step. The transformation step is executing fine. While the sync step is executing, I am getting an error says 'No receiver determination found'.
    While I am executing this sync step in a separate, it is working fine.
    Do I need to have 'Receiver determination step' between Transformation step and Sync send step? I think so. Can somebody confirms this?
    Thanks for your kind help.
    Kalyan

    Hi,
    I think there is no need of a Receiver determination step in the BPM.
    You should have a proper receiver determination in configuration for this BPM scenario. (i.e) A receiver determination from BPM to the service configured for the synchronous interface.
    Regards,
    P.Venkat

  • Need Space Between Firstname and Last Name

    Hi I am using Concat to Join First name and last name,But i need space in between...

    CONCAT("Users"."First Name",' ',"Users"."Last Name")
    Formula syntax is invalid.
    [nQSError: 10058] A general error has occurred. [nQSError: 43113] Message returned from OBIS. [nQSError: 27002] Near <,>: Syntax error [nQSError: 26012] . (HY000)
    SQL Issued: SELECT CONCAT("Users"."First Name",' ',"Users"."Last Name") FROM "Usage Tracking"
    I am getting this..

  • CIC0 Partner determination different between crmd_order and CIC0

    Hi experts,
    We have a problem with the partner determination. We have a partner who has relations with several other partners. In the partner determination procedure, we have indicatied that the partner needs at most one occurence and a selection limitation of 1. There is also an access sequence that makes sure that the right partner is found.
    This all works fine in the CRMD_order transaction. You get a list of partner to choose from when you enter the main partner. Unfortunately, this does not work in the CIC0 transaction. In this case the system takes the top partner of the list.
    Does anyone know why partner determination in CIC0 seems to ignore the setting of selection limitation and occurences? Why is this different between crmd_order and CIC0? How can we make it the same?
    Thank you for your input,
    kind regards,
    Ragina Mahadew

    Hi Ragina, welcome to SDN.
    My opinion is that main purpose for that, was to speed up the interaction registration by the call center agents.
    But if you want to display the partner selection pop-up in CIC0 t-code, you can try to implement note 487734 for that.
    Hope that helps!
    Kind regards,
    Garcia

  • Rehire - Current and last employment

    I have a employee table like this
    Sample data
    WITH emp AS
    SELECT 1 PK_ID , '10' EMP_NO , TO_DATE('01-JAN-2012')  HIRE_DATE , TO_DATE('01-APR-2012')  LAST_WORKING_DATE FROM DUAL
    UNION ALL
    SELECT 2 PK_ID , '10' EMP_NO , TO_DATE('01-JUN-2012')  HIRE_DATE , NULL LAST_WORKING_DATE FROM DUAL
    UNION ALL
    SELECT 3 PK_ID , '20' EMP_NO , TO_DATE('01-FEB-2012')  HIRE_DATE , null LAST_WORKING_DATE FROM DUAL
    UNION ALL
    SELECT 4 PK_ID , '30' EMP_NO , TO_DATE('01-AUG-2011')  HIRE_DATE , TO_DATE('01-SEP-2011') LAST_WORKING_DATE FROM DUAL
    UNION ALL
    SELECT 5 PK_ID , '30' EMP_NO , TO_DATE('01-OCT-2011')  HIRE_DATE , TO_DATE('01-NOV-2011') LAST_WORKING_DATE FROM DUAL
    UNION ALL
    SELECT 6 PK_ID , '30' EMP_NO , TO_DATE('01-DEC-2011')  HIRE_DATE , NULL  LAST_WORKING_DATE FROM DUAL
    );I need a query to fetch the current and previous employement only if the employee is rehired. Current Employment can be identified if last_working_date is null.
    So from above emp_no 10 and 30 should return pk_id 1 and 2.. where 1 is previous employment and 2 is current employement... Emp_no 20 should not be fetched since he is not been rehired in the company..
    Emp no 30 should be fetched only pk_id 5 and 6... 6 is the current employment and 5 is previous employment
    Thanks
    Vinoth.

    Try this
    SELECT pk_id, emp_no,CURRENT_HIRE_DATE , PREVIOUS_HIRE_DATE, CURRENT_LAST_WORKING_DATE, PREVIOUS_LAST_WORKING_DATE
    FROM (
    SELECT pk_id, emp_no,HIRE_DATE "CURRENT_HIRE_DATE",lead(HIRE_DATE,1,NULL) over(PARTITION BY emp_no ORDER BY DMY_ORDER) "PREVIOUS_HIRE_DATE"
           , LAST_WORKING_DATE "CURRENT_LAST_WORKING_DATE",  lead(LAST_WORKING_DATE,1,NULL) over(PARTITION BY emp_no ORDER BY DMY_ORDER) "PREVIOUS_LAST_WORKING_DATE"
           ,row_number() over (PARTITION BY emp_no ORDER BY hire_date DESC) "DMY_SLCT"
    FROM
    SELECT pk_id, emp_no,HIRE_DATE,LAST_WORKING_DATE, COUNT(emp_no) over (PARTITION BY emp_no) "CNT",
           row_number() over (PARTITION BY emp_no ORDER BY hire_date DESC) "DMY_ORDER"
    FROM 
    SELECT 1 PK_ID , '10' EMP_NO , TO_DATE('01-JAN-2012')  HIRE_DATE , TO_DATE('01-APR-2012')  LAST_WORKING_DATE FROM DUAL
    UNION ALL
    SELECT 2 PK_ID , '10' EMP_NO , TO_DATE('01-JUN-2012')  HIRE_DATE , NULL LAST_WORKING_DATE FROM DUAL
    UNION ALL
    SELECT 3 PK_ID , '20' EMP_NO , TO_DATE('01-FEB-2012')  HIRE_DATE , null LAST_WORKING_DATE FROM DUAL
    UNION ALL
    SELECT 4 PK_ID , '30' EMP_NO , TO_DATE('01-AUG-2011')  HIRE_DATE , TO_DATE('01-SEP-2011') LAST_WORKING_DATE FROM DUAL
    UNION ALL
    SELECT 5 PK_ID , '30' EMP_NO , TO_DATE('01-OCT-2011')  HIRE_DATE , TO_DATE('01-NOV-2011') LAST_WORKING_DATE FROM DUAL
    UNION ALL
    SELECT 6 PK_ID , '30' EMP_NO , TO_DATE('01-DEC-2011')  HIRE_DATE , NULL  LAST_WORKING_DATE FROM DUAL)
    WHERE CNT >=2 AND DMY_ORDER IN (1,2))
    WHERE DMY_SLCT=1;
    Output..
    PK_ID     EMP_NO     CURRENT_HIRE_DATE     PREVIOUS_HIRE_DATE     CURRENT_LAST_WORKING_DATE     PREVIOUS_LAST_WORKING_DATE
    2     10     6/1/2012     1/1/2012          4/1/2012
    6     30     12/1/2011     10/1/2011          11/1/2011
    Hope its fullfill your requirement.

  • Ora-01847 error (day of month must be between 1 and last day of month)

    Hi
    Executng the below query, I am getting error ora-01847
       INSERT INTO SVC_ORDER
          (DUE_DATE)                   
           SELECT to_date(lpad(decode(O.SVC_ORD_DT_REQ,999999,null,O.SVC_ORD_DT_REQ),6,'0'),'rrmmdd') AS DUE_DT
                  FROM M04_NT_UV_ORD_ADMIN O

    The query is from the thread I linked above
    WITH m04_nt_uv_ord_admin AS (
         SELECT '999999' svc_ord_dt_req FROM dual UNION ALL
         SELECT '120215' svc_ord_dt_req FROM dual UNION ALL
         SELECT '1231' svc_ord_dt_req FROM dual UNION ALL
         SELECT '1232' svc_ord_dt_req FROM dual UNION ALL
         SELECT '514208' svc_ord_dt_req FROM dual UNION ALL
         SELECT '120314' svc_ord_dt_req FROM dual UNION ALL
         SELECT '121312' svc_ord_dt_req FROM dual UNION ALL
         SELECT '0' svc_ord_dt_req FROM dual
    SELECT CASE WHEN
                CASE WHEN TO_NUMBER(SUBSTR(LPAD(o.svc_ord_dt_req,6,'0'),3,2))
                  NOT BETWEEN 1 AND 12
                THEN
                    'error'
                WHEN TO_NUMBER(SUBSTR(LPAD(o.svc_ord_dt_req,6,'0'),5,2))
                  NOT BETWEEN 1
                      AND TO_NUMBER(
                           TO_CHAR(
                            LAST_DAY(
                             TO_DATE(
                              SUBSTR(LPAD(o.svc_ord_dt_req,6,'0'),1,4)
                              ,'rrmm')
                            ,'dd'))
                THEN
                    'error'
                END IS NOT NULL
            THEN
                NULL
            ELSE
                TO_DATE(LPAD(o.svc_ord_dt_req,6,'0'),'rrmmdd')
            END check_date
           ,o.svc_ord_dt_req
    FROM    m04_nt_uv_ord_admin o
    WHERE   o.svc_ord_dt_req != 999999;
    CHECK_DATE SVC_ORD_DT_REQ
    15.02.2012 120215        
    31.12.2000 1231          
               1232          
               514208        
    14.03.2012 120314        
               121312        
               0  Regards
    Marcus

  • Report on Current and Last Year Sales

    Hi ,
    I have a requirement to create a report which would display in one column sales from current fiscal year/period and 2nd column sales from last fiscal year/period at the same time
    Please guide.

    Hi,
    You can achieve this by creating two selections in columns in query designer.
    First one restrict the key figure with current Fiscal period.
    Second restrict the key figure with Fiscal year with customer exit and -1 as offset value.
    Hope this helps........
    Rgs,
    Ravikanth.

  • Can a button be easily moved between Items and Region Position?

    When a button is originally defined, we have to choose whether it is to be placed amongst the items in the regions, or placed in a pre-established region position. Once the button is defined in to one of those places or the other, is there any way to "reassign" it into the other location, i.e. move it between "in the items" and "in a region position"?
    Using Apex release 4.1.1.00.23
    Edited by: Mark T. on Feb 29, 2012 11:03 AM

    I don't believe so, but it won't take long to re-create.

Maybe you are looking for

  • Embedded font in a field not printing correctly

    I have a field in my design that is configured to use Courier 10 pt. font. However, when the form prints it prints in a completely different font, Lucida Console 8 pt. When I test my presentment it prints correctly but when it prints through the Cent

  • HT204053 verifying my id BUT id spelling wrong how do I change it

    In the setup my id has one letter wrong and I am trying to change it but dont know how?

  • Why doesn't Grep Styles with pos lookbehind work?

    Hi, I've posted another thread but I suppose I expected too much. I'll try to siplify this. I have text where I want to catch underlined text: Ponny, - Cob--.499,- 125, - 135, - 145, - 155--.399,- 140, - 150, - 160, - 170--..99,- 140, - 150---99,- Th

  • 802.1x dynamic VLAN assignment with Radius NPS Server

    I can NOT get the NPS and Cisco 3550 switch to drop the authenticated user in a VLAN. I have followed this documentation, http://msdn.microsoft.com/en-us/library/dd314181(v=ws.10).aspx that basically says to use these Radius attributes, Tunnel-Medium

  • DMS integration

    How can i interface DMS (Document Management System) like SAPerion with SAP. Example scenario: a sales contract from SAP is scanned and archive in SAPerion can be retrieve when TMG wants to see the contract they have with the customer. SAPerion is a