Date Manipulations

Hi,
Iam retreving a Date column(CLI_DATE) from my database table and i want to do the following,can anyone please let me know, Is it easy using Java.Date function or Oracle Date Functions(using SQL query) to implement,and can also a sample code for this.
I have check the following conditions.
if( CLI_DATE > SYSDATE - 2MINS )
Print("OK");
else if(CLI_DATE > SYSDATE - 10MINS )
Print ("Busy");
else //(CLI_DATE < SYSDATE - 10MINS)
Print("Down");
basically i have to write it in JSP implementing Threads,checking the above condition for every 1 minute.
Thanks in Advance
Rao.

I searched on "difference between dates" and found over 7000 hits. Pretty much the whole first page, and probably a lot more than that, looked quite relevant to your question.

Similar Messages

  • Need Date manipulation in BI Publisher report template

    Hi All,
    I need date manipulation in BI Publisher report template for e.g sysdate+4 this means i need 4 days after todays sysdate.
    That menas if today date(sysdate) is 09/01/2008 then i need (sysdate+4) i.e 13/01/2008.
    Please help me.
    Thanks
    Edited by: user562690 on Jan 9, 2009 3:21 PM

    Hi M14,
    I have doubt on similar type.I have AgreementStartDate as
    <AgreementStartDate>12/03/2008 07:24:10</AgreementStartDate> in XML format.
    I am not able to apply same formula for thsi date format in similar manipulation.
    Please help me.
    TIA
    skr

  • Best Practice for Package Implementation of Data Manipulation

    Hi,
    Would like to ask which is better implementation for data manipulation (insert, update, delete) stored procedure for a single table.
    To create a single procedure with input parameter for the action such as 1 for insert, 2 for update and so on
    or
    to create separate procedures for each like procedure pInsData for insert, pUpdData for update...

    Hi,
    Whenever you create a procedure it resides as a seperate object in database.
    In my opinion its better to create a single procedure which takes care of all DML concern to a table, rather than creating different procedures for each DML.
    If your number of DML are more and interrelated then its better to create a package and put all related DML procedures in the package concern to one transaction or table. This is because whenever you will call a package entire package will be placed in the memory for a particular session. So if you create different procedures for DML then you need to call the procedures each time you want it to be executed.
    Twinkle

  • What class to use for date manipulation

    To get some experience in using Java, I would like to write a small application. I want users to enter their names and birth dates, and then I want to present the number of days they have been walking around on this planet. Furthermore, I want to present the dates when the number of days will be a nice quantity ("On February 1st, 2007 your day age will be 10.000 days", or something like that).
    To calculate the number of days, I have to do some date manipulation. Now I am wondering what date-related classes I should use. Of course, there is Date, but in the API specification, I see 'deprecated' for a lot of methods. Does this mean that the use of Date is discouraged, and/or should be avoided?
    Then, there is a class Calendar, but that's an abstract class. Thus, I cannot create a Calendar object when a user has entered his birth date (in a Swing JTextField).
    The use of GregorianCalendar seems a bit far-fetched to me, but maybe I am wrong.
    In short, when a user has entered his birth date, I want to store it in some date-like object, and I want to be able to do some arithmetic based on that object.
    Can anyone give me some clues?
    Ewout

    > The use of GregorianCalendar seems a bit far-fetched
    to me, but maybe I am wrong.
    Yes, that's the way to go.

  • How to solve "error occurred in the data manipulation engine"? 64bit Windows 7

    Hi all
    I'm having quite a testing time here trying to use the new SAP PA 2.0. After installation the software launches, the Automated Analytics seems to work fine but not the Expert Analytics.
    Steps as follows:
    Launch PA
    Choose and launch Expert Analytics
    Choose Try with Samples
    Open the Dairy Wholesaler file
    Error: An error occurred in the data manipulation engine. Check the manipulation parameters. (HDB 01001)
    I also get this same error when I try to create my own New Dataset.
    I’m on 64bit Windows 7 Pro
    Is there anyone who knows how to solve this problem. I've searched the SCN and online and have tried the following:
    1. Uninstall and re-install. Doesn't help
    2. Uninstall and delete old lumira related folders on the C drive e.g. the SAPPA and SAPVI folders on the C drive, then re-install.
    Much appreciated if anyone could shed some light on this. I've previously had Lumira working with no issues. I've since uninstalled Lumira, Predictive Analytics, and Infinite Insights (as PA 2.0 is all of this combined)
    Regards
    Ria

    In case anyone has the same problem, I found the the following helpful (taken from Error after upgrading to 1.18 ). The solution is for Lumira however its the same steps for PA2
    1.  You might want to try a ‘clean’ uninstall / reinstall . After uninstalling, try deleting these folders:
    C:\Users\Public\sapvi
    C:\Users\<user>\AppData\Local\SAP\Lumira
    C:\Users\<user>\AppData\Local\Temp\sapvi
    In this step I searched for every SAP related file in AppData in the Public, User, and my own username folder under \Users\
    2.  Next, to launch the application, explicitly click "Run as Administrator" on the install file

  • What is data manipulation

    dear experts,
    i have got a requirement saying ABAP developers needed ..in that they mentioned
    Data manipulation and Scripting...
    i am assuming data manipulation as inserting, modifying ie. doing modifications in the database
    and not sure of the scripting...
    what do they really mean?
    thanks in advance.

    LSMW Scripting tools  - the referrs to data transfer or conversion from legacy system to SAP.  LSMW is a tool within R/3 that we use to do this.
    Customizations - This could be modifying standard SAP programs to conform to the business requirement and/or writing custom programs to fill the gap
    Data Conversion -  This is converting data from 3rd party or legacy systems to SAP database.
    Data Manipulation - Again, not sure, but it could be anything related to data.
    Scripting -  I think this may refer to the sapscript forms tool that I mentioned before.
    Really all of them except for the first are a little ambiguous.
    Regards,
    RIch Heilman

  • Data Manipulation using Cubes

    Dear Experts
    My question: are BI cubes all about quering and reports? can perform data manipulation process, e.g. payroll, to the cube OLAP database directly, something like stored procedures in ordinary relational databases?????
    thanks in advance

    Hi Khidir,
    According to your description, you want to know if we can manipulation data in SQL Server Analysis Services database, right.
    As Reeves said, SSAS provide Writeback feature which is used for budgeting, forecasting or any other scenario in which you need enter data into your structure. Please refer to the link below to wee how to enable/disable writeback feature for a cube.
    http://msdn.microsoft.com/en-us/library/ms178845.aspx
    However, OLAP designed for storing and retrieving large amounts of data to be used for ad-hoc reporting and analytics. And helps users to make more informed business decisions by enabling them to analyze information accumulated during a company’s day to
    day operations.
    http://www.informit.com/articles/article.aspx?p=1313996
    http://www.nenit.net/pages/ssas.aspx
    Hope this helps.
    Regards,
    Charlie Liao
    TechNet Community Support

  • DATA manipulation #2

    hi everyone,
              my name is zhi. I have asked for help in privous post about data manipulation. I am still waiting for the other respond. however, i need to finish my porject within a week. So I really hope someone can help me to get the correct responds from the sensor.
    i am geting the reading from the micro-epsilon sensor , ILD-1800. however, i cannot get a proper reading. i know this is because i am no manipulating the data correctly. Since this is my first time doing it. i have no idea which way is the correct way to.  Plus, no one i our school know how to do data manipulation in Labview. please help.
    I have an screenshot , VI, and manufacture manual (please take a look at page 31) in attachment.
    thanks in advance.
    zhi
    Attachments:
    ILD1800_X9751053-C07.pdf ‏1057 KB
    trial2.vi ‏59 KB
    shot1.JPG ‏180 KB

    Hi Zhi,
    I'm guessing you're looking for the Join Numbers and the Logical Shift. 
    I'll post some screenshots that show where they are.
    Message Edited by pallen on 04-24-2008 03:46 PM
    Patrick Allen
    Attachments:
    join numbers.jpg ‏54 KB
    Logical Shift.jpg ‏53 KB

  • Row data manipulation in WD SALV_WD_TABLE

    Dear Gurus,
    I have a requirement in which i am using the standard WD component SALV_WD_TABLE in my custom WD component. Here i need to disable the checkbox in the first column based on a certain vallue in another column. Ex: I have the ALV displaying check box as first column followed by Purchase Order details like PO number, status, cost center etc. If the status has the value "Ordered" the checkbox should be displayed.
    I tried to set the check box with method set_read_only(abap_true). But this disables check boxes on all rows. How do i do this conditionally. I found threads to do something for all rows in a column like setting a particular colour.
    Regards,
    Manidipa

    Hi
    Take one attribute READONLY type String
    Take antoher internal table and move the contents of internal table to another to do manipulation and last bind the copied internal table.
    method WDDOINIT .
      data : lo_nd_spfli_node TYPE REF TO if_wd_context_node,
             lo_el_spfli_noed TYPE REF TO if_wd_context_element,
             lt_sflight TYPE if_main=>elements_spfli_node,
             lt_final TYPE if_main=>elements_spfli_node,
             ls_final TYPE if_main=>element_spfli_node,
             ls_flight TYPE if_main=>element_spfli_node.
          lo_nd_spfli_node = wd_context->get_child_node( 'SPFLI_NODE' ).
    SELECT * FROM
      SFLIGHT INTO CORRESPONDING FIELDS OF
      TABLE LT_SFLIGHT UP TO 60 ROWS.
      LOOP at lt_sflight into ls_flight.
        MOVE ls_flight to ls_final.
        if ls_final-carrid EQ 'AA'.
            ls_final-readonly = abap_FALSE.
        ELSE.
           ls_final-readonly = ' '.
        ENDIF.
        APPEND ls_final to lt_final.
      lo_nd_spfli_node->bind_table( lt_final ).
      ENDLOOP.
      DATA: l_ref_cmp_usage TYPE REF TO if_wd_component_usage.
      l_ref_cmp_usage = wd_this->wd_cpuse_alv( ).
      IF l_ref_cmp_usage->has_active_component( ) IS INITIAL.
        l_ref_cmp_usage->create_component( ).
      ENDIF.
    DATA lo_interfacecontroller TYPE REF TO iwci_salv_wd_table .
    lo_interfacecontroller =   wd_this->wd_cpifc_alv( ).
      DATA lv_value TYPE REF TO cl_salv_wd_config_table.
      lv_value = lo_interfacecontroller->get_model(
    CALL METHOD lv_value->if_salv_wd_table_settings~set_read_only
      EXPORTING
        value  = ABAP_FALSE
    DATA:
    lr_input_field TYPE REF TO cl_salv_wd_uie_input_field,
    lr_column TYPE REF TO cl_salv_wd_column,
    lr_cb TYPE REF TO CL_SALV_WD_UIE_CHECKBOX,
    lr_column1 TYPE REF TO cl_salv_wd_column.
    lr_column1 = lv_value->if_salv_wd_column_settings~get_column( 'READONLY' ).
    CREATE OBJECT lr_cb
    EXPORTING
    CHECKED_FIELDNAME = 'READONLY'.
    lr_column = lv_value->if_salv_wd_column_settings~get_column( 'CARRID' ).
    CREATE OBJECT lr_input_field EXPORTING value_fieldname = 'CARRID'.
    lr_column1->set_cell_editor( lr_cb ).
    lr_column->set_cell_editor( lr_input_field ).
    lr_cb->set_read_only_fieldname( value = 'READONLY' ).
    check with above code it works for your requirement
    Thanks,
    Tulasi Palnati

  • Date Manipulation

    Currently, i'm designing an application which needs to correctly insert/fetch data of type Date to/from a database.
    Unfortunately, i'm new to the java utilities for doing manipulation of Date-type data.
    I need help to design procedures to do some things:
    First, let say I have objects of type Date, (d1 = 29/April/2008, Sunday), (d2 = 4/May/2008), and (d3 = 31/April/2008, Thursday).
    1. I need to validate & verify the date. I need a procedure which can tell me that the d1 is present in the real world thus it is a valid date, and in contrast d3 is not.
    2. I need procedures to operates the date objects.
    I need a procedure which tells me that d2 - d1 is 5 days.
    I need a procedure which can create a new date object if I add some days to a date object. For example d1 + 4 produces (d4 = 3/may/2008). And d2 - 4 produces (d5 = 30/April/2008).
    3. I need a procedure which tells me the name of the day for a certain date. For example, getDayName(d1) will return "Sunday".
    I really appreciate if You know some things about the issues above.
    p.s. As for the databases, I use the MsAccess 2000 for prototyping and MySQL for the real thing.

    akkumaru wrote:
    Currently, i'm designing an application which needs to correctly insert/fetch data of type Date to/from a database.
    Unfortunately, i'm new to the java utilities for doing manipulation of Date-type data.
    I need help to design procedures to do some things:
    First, let say I have objects of type Date, (d1 = 29/April/2008, Sunday), (d2 = 4/May/2008), and (d3 = 31/April/2008, Thursday).
    1. I need to validate & verify the date. I need a procedure which can tell me that the d1 is present in the real world thus it is a valid date, and in contrast d3 is not.If it's a Date object, there's nothing to validate--it is a "real" date. You're talking about validating String objects that represent Dates, not Date objects. Use SimpleDateFormat.parse(). If you setLenient(false) it will throw an exception on dates like April 31, rather than turning them into real dates.
    2. I need procedures to operates the date objects.
    I need a procedure which tells me that d2 - d1 is 5 days.Once you have two Date objects (as opposed to the String objects you have above), you have a couple of approaches:
    * Call Date's getTime() method on the two Dates, subtract the resulting millis, and divide by the number of millis in a day. Depending on your specific rules for how to count elapsed days, and due to the fact that not all days have the same number of millis, this may or may not give you the results you need.
    * Put the Dates into a Calendar. Add one day to the earlier date repeatedly until it catches up with the later date. This is simple and guranteed to be easily adaptable to your rules for elapsed days, but may be too big a performance it if you have to to it often for dates that are far apart.
    * A variation of the above is to add 365 days to the earlier date reapeatedly until the dates are within a year of each other, and then add or subtract days as needed to get them to match. This will be quicker for dates that are several years apart, but the code is slighly more complex.
    I need a procedure which can create a new date object if I add some days to a date object. For example d1 + 4 produces (d4 = 3/may/2008). And d2 - 4 produces (d5 = 30/April/2008).Calendar has an add method that will let you do this.
    3. I need a procedure which tells me the name of the day for a certain date. For example, getDayName(d1) will return "Sunday".SimpleDateFormat.
    p.s. As for the databases, I use the MsAccess 2000 for prototyping and MySQL for the real thing.I thought you were talking about Java dates. Are the DB columns of type DATE or DATETIME? Or are they VARCHAR?

  • Spreadsheet data manipulation?

    We use Designer to transfer data so that it can be imported into our systems without any manipulation... We use forms that allow customers to submit the forms to us via email... so...
    When you use Professional to create a spreadsheet from data files all of the data dumps into Excel horizontally across the first row on excel.... Is there anyway to make it so that the PDFs we create will dump their information into Excel columns?
    So instead of the data dumping like:
    1 2 3 4 5 6 7 8 9 etc...
    Is there a way for the data to dump like:
    1 4 7
    2 5 8
    3 6 9 etc...

    Hi Sandeep
    yes it is definately possible , while craeting your ZTABLE just while setting delivery and maintenance atrribute  under delivery and maintenance  tab just set
    Data Browser/Table View Maint. as ->Display/maintenance allowed
    Thanks
    And please reward points

  • Date Manipulation Depending on the various user date settings

    hi,
    I have a query.
    In scripts, user date format setting is YYYY.MM.DD, values stored the table MHND are also in the format YYYY.MM.DD.
    However when i pass the date values from MHND from form to subroutine pool the dates are available in the format DD.MM.YYYY in the subpool.
    I want to calculate the diffenece between two dates. I have checked the function modules to calculate the differece betweent 2 dates those acccepts dates with type YYYYMMDD.
    However i tried to bring my dates in from YYYY.MM.DD into YYYYMMDD format by using CONVERT_DATE_INTERNAL function module... That is not working as the user date format is YYYY.MM.DD and the dates are coming in subpool in DD.MM.YYYY format....
    Please suggest me the approach the relavant function modules.... so as to manipulate the dates based on the user date settings.
    Looking forward for your replies. Thanks in advance.
    Regards,
    Anuja.

    hi anuja,
    Try using the following formatting  script symbol in your form routine
    For example, you are passing the date into the subroutine then put K after the date field like below.
    &date(K)& .
    or
    use SET DATE MASK : YYYY:MM:DD
    Thanks,
    Vamshi

  • Need help in FDM data manipulations

    Hi,
    I am fairly new to Hyperion FDM and still learning its features with Planning. I have following scenario.
    I need to move my data from Dept ABC to Dept XYZ when the account = '10000'. I have both the ABC and XYZ depts in my Planning system.
    Is there a way I can accomplish this in FDM? I am looking at the document, but not sure where to look at it.
    If you can provide some insight on this that will be great.
    Thanks,
    NM

    Hi NM,
    Please see my response to your question on the Network 54 forum.
    FDM is really intended to perform data loads from a source system than move data around within the cube.
    Your requirement is somewhat ambiguous and it sounds like you want to move a specific piece of data that resides within the planning cube already rather than make all future data load like this. Presuming this is a one time activity you may consider using a calc script/business rule.
    You will find that may people use both forums and posting to one is a more effective way to rely on people answering your queries.
    Regards,
    John

  • Internal table -Logic-Data manipulation

    Hi,
    I have following requirement.
    Input Internal table
    *A T1   1   3
    *A T2   4   5
    *A T3   1   2
    *B T4   1   2
    *B T5   3   6
    *B T6   1   7
    Output
    *A T1   1     3
    *A T2   4     5
    *B T6   1     7
    basically i should delete overlapping records 
    eg: since A t3 1 2 is overlapping record it should be deleted.
    report x.
    DATA: BEGIN OF ITAB OCCURS 0,
          FLD1  TYPE CHAR20,
          FLD2  type char20,
          NUM1  TYPE I,
          NUM2  TYPE I,
          END   OF ITAB.
    ITAB-FLD1 = 'A'.
    ITAB-FLD2 = 'T1'.
    ITAB-NUM1 = '1'.
    ITAB-NUM2 = '3'.
    APPEND ITAB.
    ITAB-FLD1 = 'A'.
    ITAB-FLD2 = 'T2'.
    ITAB-NUM1 = '4'.
    ITAB-NUM2 = '5'.
    APPEND ITAB.
    ITAB-FLD1 = 'A'.
    ITAB-FLD2 = 'T3'.
    ITAB-NUM1 = '1'.
    ITAB-NUM2 = '2'.
    APPEND ITAB.
    ITAB-FLD1 = 'B'.
    ITAB-FLD2 = 'T4'.
    ITAB-NUM1 = '1'.
    ITAB-NUM2 = '2'.
    APPEND ITAB.
    ITAB-FLD1 = 'B'.
    ITAB-FLD2 = 'T5'.
    ITAB-NUM1 = '3'.
    ITAB-NUM2 = '6'.
    APPEND ITAB.
    ITAB-FLD1 = 'B'.
    ITAB-FLD2 = 'T6'.
    ITAB-NUM1 = '1'.
    ITAB-NUM2 = '7'.
    APPEND ITAB.
    LOOP At ITAB.
    ENDLOOP.

    Hi Praveen,
    You have to SORT the internal table ITAB by a field of your requirement. Then DELETE adjacent entries in the internal table by comparing the field of interest.
    SORT ITAB BY NUM1 NUM2.
    DELETE ADJACENT DUPLICATES FROM ITAB COMPARING NUM1 NUM2.
    After doing this you can perform the required actions on ITAB.
    Hope this has cleared your doubt.
    Thanks & Regards,
    Ramya Shree.M.R

  • Oracle 9i function to perform data manipulation

    Hi everyone,
    I have two scenarios. I would like to write one Oracle 9i function that can accommodate both these scenarios, using PL/SQL developer. I intend passing a varchar2 parameter to this function. Within the function, I perform a select on a table and see if this value sent has a parent record.
    If it does not have a parent record (null or blank) then I take this value, join with another table, perform some processing and return one varchar2 value.
    If it has a parent record (not null or not blank) then I need to retrieve all the other children records associated with this same parent record, take this value, join with another table,perform some processing and return one varchar2 value.
    I have two simple queries that I wrote: one for record with null/blank parent, and the other for record with same parent and other children. These two queries work individually, when I combine them is where I run into problems. Sample table:
    TABLE XYZ data: (note: if there is a parent, parent shows up in both parent and child field in the table)
    child parent
    1234
    5107 3167
    6259 3652
    5678 9754
    3167 3167
    3652 3652
    1649
    2306 9754
    4657 3652
    9754 9754
    8753 3652
    passing record 1234 into the function.
    SELECT A.child, A.parent, C.field1
    FROM OTHERTABLE C,
    (SELECT TableA.child, TableA.parent
    FROM XYZ TableA
    WHERE TableA.child ='1234')A
    WHERE A.child = C.field2
    ----(output of this query is 1 record with 3 fields 1234 and null/blank and 987654321. I place this output into a cursor and then take 987654321 and place into a variable and return this value)
    passing record 4657 into the function
    SELECT c.CHILDfield, c.PARENTfield, TableOther.field1
    FROM OTHERTABLE TableOther,(
    (SELECT B.CHILDfield, B.PARENTfield FROM
    (SELECT A.PARENTfield, i.CHILDfield FROM TableB,
    (SELECT TableA.CHILDfield, TableA.PARENTfield
    FROM XYZ TableA
    WHERE TableA.CHILDfield ('4657' ))A
    -- pass 4657 and then get the parent
    WHERE A.PARENTfield = TableB.PARENTfield)B
    -- gets associated children with the parent from previous query.
    -- note: parent can exist in the parent and child fields
    WHERE B.CHILDfield <> B.PARENTfield))C
    --strips off the parent and gets child/children only as I don't need
    --the parent when it is also a child
    WHERE C.CHILDfield = TableOther.field1
    --(output of this query is 3 records
    4657 3652 912345671
    6259 3652 945362798
    8753 3652 934274857)
    I place this output into a cursor and then have a CASE statement that goes thru each record, and appends the third value into a variable, the ultimate return value of this will be as follows:
    912345671;945362798;934274857)
    The dilemma is writing a generic query to accommodate both these situations. My current function can handle each of these situations individually, but not both. For testing purposes, I change the select statement depending on whether I have a record that has a parent on not!
    Any help is greatly appreciated.

    You want one function to handle two cases? This is the best opportunity to use the IF STATEMENT.
    FUNCTION MyFunc (p_input IN VARCHAR2) RETURN VARCHAR2 IS
    ReturnValue VARCHAR2;
    BEGIN
    IF <blank or null test> THEN
    SELECT ... -- Blank or null select statement
    ... -- Blank or null data processing
    RETURN ReturnValue;
    ELSE
    SELECT ... -- Other select statement
    ... -- Other data processing
    RETURN ReturnValue;
    END IF;
    END MyFunc;

Maybe you are looking for

  • New MacBook video on youtube?

    This youtube video has a person showing us the new MacBook, it has the edge to edge keyboard and top right earphone jack, is this legitimate? https://www.youtube.com/watch?v=pF9NWy_rRF4

  • Mail not sent using SO_NEW_DOCUMENT_SEND_API1

    Hi, I am using report RSCONN01 after the FM SO_NEW_DOCUMENT_SEND_API1 to send email. Eg: submit rsconn01 with mode = 'INT'                 with output = 'X'                 and return. But this report gives a popup which is creating a problem. Is the

  • Ora-02068 error

    Hi, Today i had checked my alert log file i can see the below error message. i'm using oracle 10.2.0.4.0 64 bit. can someone tell me what could be reason for this error Mon Sep 19 01:18:04 2011 Error 2068 trapped in 2PC on transaction 2.40.522651. Cl

  • ESS/MSS Configuration Help

    Hi Friends, Can anyone help me with some reference documents for ESS/MSS configuration and integration of ABAP report/Infotypes on ESS portal. Regards, Ameet

  • [SOLVED] on last reboot, two wicd-clients running + two tray icons?

    Hi, I've been using wicd forever and for the first time, I had two tray icons showing this morning. I used to use xfce but switched to openbox about a month ago and have been using an autostart.sh like so: $ cat .config/openbox/autostart.sh |tail #bg