How to get the time difference (in seconds) between two timestamp fields?

Hi All,
I'm exploring validation expressions in SAP MDM Data Manager version 7.1.07.245
I have two timestamp fields, suppose Update Date and Update-GDS.
What I'm trying to do is prompt a warning when:
(Update Date minus Update-GDS) is greater than or equal to zero seconds
AND
(Update Date minus Update-GDS) is less than or equal to 900 seconds
the bottomline is, Update Date must be equal or greater than to Update-GDS but Update Date must not exceed 900 seconds difference.
my initial try was:
(Update Date - Update-GDS)>=0 s AND (Update Date - Update-GDS)<=900 s
But it always returns true even the time difference between update date and update-gds is beyond the condition.
Can you please guide me through this?
Thank you very much in advance.
Regards,
~erwin

Hi Abhishek,
I tried your code but it always returns true.
It seems subtraction of timestamp fields do not actually get the time difference... (in seconds)
Is this possible anyway? Or is there any other better approach on this?
Thanks,
~erwin
Edited by: erwin.j.rivera on Dec 14, 2011 8:40 AM

Similar Messages

  • How to write a query to get the time difference of two varchar type time columns

    Hi,
    I want to get the time difference between the two varchar type columns.please see the attached image for more details:
    My requirement is like:
    timestarted
    timeended
    timediff
    9:00:00
    10:00:00
    1:00
    9:15
    9:30:00
    0:15

    Storing time alone as VARCHAR2 value is a incorrect design. Always store it as DATE or TIMESTAMP.
    If you already have a messed up design and cant change it, then you need to convert your VARCHAR2 time into a DATE or TIMESTAMP and find the difference. I have converted it to TIMESTAMP and obtained the difference as INTERVAL.
    SQL> with t
      2  as
      3  (
      4  select '09:00:00' timestarted, '10:00:00' timeended from dual
      5  union all
      6  select '09:15:00' timestarted, '09:30:00' timeended from dual
      7  )
      8  select timestarted
      9       , timeended
    10       , (timeended - timestarted) day to second diff
    11    from (
    12          select to_timestamp('01011900' || timeended, 'ddmmyyyyhh24:mi:ss') timeended
    13               , to_timestamp('01011900' || timestarted, 'ddmmyyyyhh24:mi:ss') timestarted
    14            from t
    15         );
    TIMESTARTED                                        TIMEENDED                                          DIFF
    01-JAN-00 09.00.00.000000000 AM                    01-JAN-00 10.00.00.000000000 AM                    +00 01:00:00.000000
    01-JAN-00 09.15.00.000000000 AM                    01-JAN-00 09.30.00.000000000 AM                    +00 00:15:00.000000
    SQL>

  • How to get the time interveral for each status of worklow (wating,Inprocess

    Hi Friends,
    I have requreiemnt to get the time interval for each status of workflow.
    ex.
                                                                     status
    workflow id  | startd date | enddate       | waiting | Inprocessing|Error|......
    1026            10.10.2008  25.10.2008        1hr      1hr 30 min    2 hr
    Please do give me idea how to get the time stam of each status of workflow.
    Thanks,
    D.prabhu

    Hi,
    I think the following tables would be helpful to you:-
    SWW_CONT     Container Contents for Work Item Data Container
    SWW_CONTOB     "Container Cont. for Work Item Data Container (Only Objects)"     
    SWWLOGHIST     History of a work item     
    SWWORGTASK     Assignment of WIs to Org.Units and Tasks     
    SWWUSERWI      Current Work Items Assigned to a User     
    SWWWIHEAD     Header Table for all Work Item Types
    Hope it Helps!
    Regards,
    Kanika

  • How to find the time difference..?

    HI
    How to find the time difference between two times
    for Example
    the difference between '24/10/2005 8:25:00 PM' and '25/10/2005 5:20:00 AM'
    is 8.55
    Kris

    This is a procedure taht do the job
    CREATE OR REPLACE FUNCTION Diff_Time
         LD$Date_Deb IN DATE DEFAULT SYSDATE
         ,LD$Date_Fin IN DATE DEFAULT SYSDATE
         ,LN$JJ       OUT PLS_INTEGER
         ,LN$HH       OUT PLS_INTEGER
         ,LN$MI       OUT PLS_INTEGER
         ,LN$SS       OUT PLS_INTEGER
      ) RETURN NUMBER
    IS
      dif   NUMBER ;
    BEGIN
      IF LD$Date_Fin < LD$Date_Deb THEN
         RETURN ( -1 ) ;
      END IF ;
      SELECT  LD$Date_Fin - LD$Date_Deb INTO dif  FROM dual ;
      SELECT  TRUNC ( LD$Date_Fin - LD$Date_Deb)  INTO LN$JJ  FROM dual ;
      SELECT  TRUNC ( (LD$Date_Fin - LD$Date_Deb) * 24) -  ( LN$JJ * 24 ) INTO LN$HH FROM dual ;
      SELECT  TRUNC ( (LD$Date_Fin - LD$Date_Deb) * 1440) - ( (LN$HH * 60) + ( LN$JJ * 1440) ) INTO LN$MI FROM dual ;
      SELECT  TRUNC ( (LD$Date_Fin - LD$Date_Deb) * 86400) - ( (LN$MI * 60) + (LN$HH * 3600) + ( LN$JJ * 3600 * 24 ) ) INTO LN$SS FROM dual ;
      RETURN( dif ) ;
    END ;
    /You may have to modify it to fit your own requirement.
    Francois

  • How to calculate the Time difference between 2 dates

    HI All,
    I am using HR_hk_diff_btw_2_dates to calculate the employee service dates.
    For that i  am inputing his hire date and Term dates and Output format as '05' i am getting output perfectly....
    But problem is  whe i am inputting the employee hire date is Dec 1 2007 and Term date is
    March 31 2009 It is coming as 1 year 3 months  31 days instead of 1 year 4 months directly .......How could we make it make last date also working day and get the O/p as 1 year 4 months ?Please Advice..
    Regard
    sas

    1. FM for difference betwwen two times:SCOV_TIME_DIFF
    Import parameters               Value
    IM_DATE1                        2008-01-01
    IM_DATE2                        2008-01-01
    IM_TIME1                        10:00:00
    IM_TIME2                        11:30:00
    Export parameters               Value
    EX_DAYS                         0
    EX_TIME                         01:30:00
    2. SD_CALC_DURATION_FROM_DATETIME : Finds the difference between two date/time and report the difference in hours
    L_MC_TIME_DIFFERENCE : Finds the time difference between two date/time

  • How to get the Time Stamp if we use User Status

    Hi Gurus,
    We used User Status to control several Orders. Now we are required to get the "time stamp" when we change from one status to another, is that information available in the system?
    If not, how do we get the time when a user status is changed from one to another?
    please advice,

    Hi,
    To check such kind of changes you have to follow below path,
    Go to Status tab (Blue Ikon) --- >Extra -> Change Documents-> All- --- > Choose All Changes
    SAP note 390635 provide the possibility to write change records for process and production orders as modification.
    please refer this link also,
    [Link|https://www.sdn.sap.com/irj/sdn/profile?userid=3781605]
    Regards,
    R.Brahmankar

  • How to calculate the time difference in answers

    Hi,
    I need to calculate the time difference in BI answers and I dont have the access to the repository. I have the data in the following format
    10/12/2005 7:24:19 PM 10/12/2005 7:32:04 PM
    10/12/2005 7:50:47 PM 10/12/2005 8:52:36 PM
    10/12/2005 7:54:23 PM 11/4/2005 10:47:32 PM
    10/12/2005 9:05:51 PM 10/12/2005 9:08:58 PM
    10/12/2005 9:07:42 PM 10/12/2005 9:14:47 PM
    10/12/2005 9:09:02 PM 10/12/2005 9:10:57 PM
    I need to get the elapased hours between these two columns. Please help me
    Thanks

    you can use beans or create a case when statement like:
    case
    when TimeStampDiff(SQL_TSI_Min, table.column1, table.column2 ) <= 60 then 1 else
    when TimeStampDiff(SQL_TSI_Min, table.column1, table.column2 ) > 60 and TimeStampDiff(SQL_TSI_Min, table.column1, table.column2 ) <= 90 then 1.5 else
    when TimeStampDiff(SQL_TSI_Min, table.column1, table.column2 ) > 90 and TimeStampDiff(SQL_TSI_Min, table.column1, table.column2 ) <= 150 then 2.5 else
    end

  • How to get the time length from send record command to record video really?

    I have two buttons. Record/Stop
    I press Record button to record the video and press Stop
    button to stop recording.Now,I spend 1986 ms from press Record
    button to press Stop button.
    But the flv file's length is 1920 or 1910 or 1915 ms.
    So I want to get the time length from send record command to
    record video really.
    Can you give me some suggests.
    Thanks!

    maybe you have lag in publishing.... are you try watch de
    NetStream.liveDelay() method?
    or start counting when NetStream.onStatus has
    "NetStream.Record.Start" and "NetStream.Record.Stop" in information
    objects....

  • How to get the number of years, months with two sysdate()

    Hi All,
    Sorry for posted another question regarding the conversion.
    I have the hiring day and current day in date format like : '2005-10-01' and '2006-09-14'
    How to get the differences between current date is ('2006-09-01') and
    hiring date is ('2004-10-01' )
    in the format number of years and number of month without using the Mod
    function . For this example the result is : 2 years 1 month
    Thanks
    JP

    How to get the differences between current date is ('2006-09-01') and
    hiring date is ('2004-10-01' )
    in the format number of years and number of month without using the Mod
    function . For this example the result is : 2 years 1 monthshould not it be 1 year 11 months???
    SQL> select (date '2006-09-01' - date '2004-10-01') year to month diff from dual;
    DIFF
    +01-11

  • How do I set Time Machine to alternate between two attached external drives (so that if one fails I will have a separate backup to use)?

    Hi Everyone.
    Thanks in advance for your help.
    Right off the bat let me say I am using Mavericks 10.9.1 on a 2011 Macbook Pro and using all Lacie external hard drives.
    I am trying to get Time Machine to alternate between two attached external hard drives, trying to be safe in case one of the backup drives itself fails.
    I have both drives set in Time Machine.
    From what I gather Time Machine should by default alternate between drives when backing up (I would assume it does one big initial backup on each then subsequent backups are just changes).
    But this is not how it seems to be working and I cannot find a straight answer despite much Googling and Foruming
    Unfortunately it seems to only be backing up to "External Hard Drive 1".
    There have been 4 backups since I set it up, all on "External Hard Drive 1", even though "External Hard Drive 2" is also attached and set in Time Machine.
    I manually clicked "Back Up Now" and it started to work on "External Hard Drive 2" (like I want it to) for a minute but it appears to have stopped and gone back to backing up to "External Hard Drive 1".
    Am I missing something? Does Time Machine only move on to another disk when the first one runs out of space? Do I have to turn one off in order to force it to back up to the other drive (that would be less convenient of course)?
    I am hoping that I am missing something and that it will just alternate between the two. Otherwise it is not the most comforting and thorough backup system as I had hoped when I purchased the additional external hard drive.
    I have a 1TB drive and a 500gig partition on another drive, both dedicated to backups (my Macbook HD is 475gig). It will take awhile for each to fill up and who knows what could happen during that time. Having Time Machine alternate between hard drives would be a nice small bit of security if the worst happened.
    I realize that there are tons of other options for backing up but I just want to use Time Machine if I can.
    Again thank you for your help!

    You cannot use Time Machine in that way. I'm not sure where you heard that Time Machine alternates between drives automatically. What you can do is create a mirrored RAID array for the backup. This automatically duplicates whatever is on one drive onto the other drive.
    Both drives must be the same size, and prefereably, exactly the same make and model. RAIDs can be configured using OS X's Disk Utility.
    RAID Basics
    For basic definitions and discussion of what a RAID is and the different types of RAIDs see RAIDs.  Additional discussions plus advantages and disadvantages of RAIDs and different RAID arrays see:
    RAID Tutorial;
    RAID Array and Server:
    Hardware and Service Comparison.
    Hardware or Software RAID?
    RAID Hardware Vs RAID Software - What is your best option?
    RAID is a method of combining multiple disk drives into a single entity in order to improve the overall performance and reliability of your system. The different options for combining the disks are referred to as RAID levels. There are several different levels of RAID available depending on the needs of your system. One of the options available to you is whether you should use a Hardware RAID solution or a Software RAID solution.
    RAID Hardware is always a disk controller to which you can cable up the disk drives. RAID Software is a set of kernel modules coupled together with management utilities that implement RAID in Software and require no additional hardware.
    Pros and cons
    Software RAID is more flexible than Hardware RAID. Software RAID is also considerably less expensive. On the other hand, a Software RAID system requires more CPU cycles and power to run well than a comparable Hardware RAID System. Also, because Software RAID operates on a partition by partition basis where a number of individual disk partitions are grouped together as opposed to Hardware RAID systems which generally group together entire disk drives, Software RAID tends be slightly more complicated to run. This is because it has more available configurations and options. An added benefit to the slightly more expensive Hardware RAID solution is that many Hardware RAID systems incorporate features that are specialized for optimizing the performance of your system.
    For more detailed information on the differences between Software RAID and Hardware RAID you may want to read: Hardware RAID vs. Software RAID: Which Implementation is Best for my Application?

  • How to get the timer in flex

    Hi,
    i am doing a game in  flex. The game is, there is object which escaping  from the balls coming toward it.If the ball hit means the object falls down.
    My question is i want to get the balls in increasing manner.suppose in first 5 seconds in ball comes means , in next 5 secounds 3 balls must come like that.
    Can any one suggest how to solve this problem?

    If this post answers your question or helps, please mark it as such.
    This should get you started:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
      creationComplete="timer.addEventListener(TimerEvent.TIMER, timerFunc);"
      viewSourceURL="srcview/index.html">
      <mx:Script>
        <![CDATA[
          private var timer:Timer = new Timer(1000, 0);
          [Bindable] private var numBalls:uint = 1;
          private function timerFunc(event:TimerEvent):void{
            numBalls+=2;
        ]]>
      </mx:Script>
      <mx:Label id="lbl" text="{numBalls} ball(s) falling now" fontSize="100" textAlign="center"/>
      <mx:Button label="Start Game" click="timer.start();"/>
      <mx:Button label="Stop Game" click="timer.stop();numBalls=1;"/>
    </mx:Application>
    Greg Lafrance
    www.ChikaraDev.com
    Flex Development and Support Services

  • How to set the time difference between each data when sweeping voltage using keithley 2400

    Hello friends,
    I am using the sweep vi from Keithley in the SWEEP and Acquire measurement vi.I want to measure the voltage for every step and insert a delay in between every two data, so I need some delay between each I step.
    I am a starter to use Labview, thanks so much for your answers.
    Perry
    Solved!
    Go to Solution.
    Attachments:
    Keithley 24XX Sweep and Acquire Measurements.vi ‏26 KB

    As Dennis said, if you're using the built-in sweep function, you'll have to check the manual. See Section 10-16 (That's section 10 page 16, not sections 10 though 16) of the Keithley 2400 User Manual.
    The Keithley 24xx series has a measurement speed in units called PLC (Power Line Cycles). The default speed is 1PLC, meaning a measurement is taken every 1 power line cycle, or 1/60th of a second (16.67ms). 24XX's can go from 0.01 PLC (every 0.16ms) to 10 PLC (every 166.6ms). The faster you measure, the lower precision you get.
    To set this value programmatically, the command is
    ENSe:CURRent:NPLCycles <n>
    ENSe:VOLTage:NPLCycles <n>
    depending on what you're sensing and where <n> is the number of PLCs from 0.01 to 10.
    Another factor that will determine the time between data points is the SDM cycle. These are more complicated, look at your Keithley user manual for more information. Look at Section 6 and Section 11 for more info.
    Note:
    PLC times are based on a US cycle of 60Hz.

  • How to get the time for executing an SQL statement?

    hi all...
    How can I get the total execution time for a given SQL statement to a ViewObject which is created dynamically for this SQL so that the end user knows it before hand and try to stop it or go further..?
    Please post any ideas if you have got..!!!
    thanx in advance..
    grüss
    K°vi

    This is not really a question for the JDeveloper forum, but rather for the DB forum.
    Since Oracle9i there is a way to estimate how long a query will take, before executing it.
    Check it out in the Oracle DB documentation or ask on the DB forum.
    There is no built-in functionality for this in JDeveloper, but you should be able to call out to the DB from your Java code to get the estimate.

  • How to query the number of working days between two dates

    I'm looking for a solution to calculate the number of <i>working</i> days between two dates that I can use in a formated search. 
    Calculating the total number of days is pretty straight forward but does anyone know how to take into account the settings in the HLD1 (Holiday Dates) table?

    Hi Eric,
    If you are purely looking to exclude holidays defined in the HLD1 table, then you should be able to do it with the following query
    NOTE: The following query is an example using OINV table and the fields DOCDATE and DOCDUEDATE for a Particular DOCNUM  'xxx'
    If you planning to use within the SAP module then replace DOCDATE and DOCDUEDATE with dynamic field references $[$x.x.x]
    SELECT DATEDIFF(DAY,T0.DOCDATE,T0.DOCDUEDATE)-
    (SELECT COUNT(STRDATE) FROM HLD1 WHERE STRDATE >= T0.DOCDATE AND STRDATE <= T0.DOCDUEDATE)
    FROM OINV T0
    WHERE T0.DOCNUM = xxx
    Best Wishes
    Suda

  • How to get the row difference from two tables

    I am not good at SQL. Here is a problem I am having
    I have two tables say Employee_Master and Employee_Today. Employee_Today table is basically a subset of Empolyee_Master. At a given time, I want to query the database and and get all the employee names from Employee_Master table that are NOT in the Employees_Today table. How would I write that?
    Select a.name from Employee_Master a, Employee_Today b where ..........?
    Thanks for suggstions

    if i understand your requirement correctly try this:
    Select a.name from Employee_Master a
    Where  Not Exists
          (Select 'x' From Employee_Today b
           Where  b.name = a.name) ;hope this helps

Maybe you are looking for

  • Error messages when calling RSDRI_INFOPROV_READ for more than one time

    Hello all, I need to write a cube, however, before I do this I need to check whether there are already data in the target cube for a certain accounting period. This I do by reading the cube via FM RSDRI_INFOPROV_READ. The following coding is called f

  • HU_CREATE_GOODS_MOVEMENT refresh problem

    I am using FM HU_CREATE_GOODS_MOVEMENT to make a 311 movement. When I run it twice, the first is correct but in the second appears a DUMP. I have solved it creating a simple report ZHU_CREATE_GOODS_MOVEMENT which just launch the FM. Then, in my progr

  • Warning: [unchecked] unchecked conversion.. how to avoid this warning?

    Hi all, When i compile my java file, i get this warning. Z:\webapps\I2SG_P2\WEB-INF\classes\com\i2sg>javac testwincDB.java Note: testwincDB.java uses unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. Z:\webapps\I2SG_P

  • Time supply in replenishment

    hi all, A sku is placed on Time Supply replenishment. if we select stock category as direct to store , do we need to make sure that the min days of supply should always be set more than the supplier lead time ? regards, deepak

  • Read specified content of a xml file

    How to get specified part of a xml file This is the content of the xml file, I just want the content in the <body>...</body> without the <p></p> tag. How can I do that? <?xml version="1.0" encoding="UTF-8"?> <TEI.2> <teiHeader> <fileDesc> <titleStmt>