How to get the time in hours minutes and seconds subtraction between two varchar t

Hi all

I have two variable varchar that has a value like this

v_outpunch1: = 17: 50:00'
and v_Shifttime: = 18:00:00 '


This time I'm subtracting here and in another varchar variable
who's like that.



v_EarlyLeaverstimeformat: = ((extrait extrait de (heure de TO_TIMESTAMP (v_ShiftTime, 'HH24:mi:ss'))-(heure de TO_TIMESTAMP (v_OutPunch1, 'HH24:mi:ss') LPAD)), 2, '0'): ': ' |)) LPAD ((extrait (minute de TO_TIMESTAMP (v_ShiftTime, 'HH24:mi:ss'))-extrait (minute de TO_TIMESTAMP (v_OutPunch1, 'HH24:mi:ss'))), 2, '0'): ': ' |)) LPAD ((extrait (seconde de TO_TIMESTAMP (v_ShiftTime, 'HH24:mi:ss'))-extrait (seconde de TO_TIMESTAMP (v_OutPunch1, 'HH24:mi:ss'))), 2, '0');))



It is not properly subtracting value.

Thank you

This works for me...

SQL> ed
Wrote file afiedt.buf

  1  with t as(select to_date('17:50:00','HH24:MI:SS') as out, to_date('18:00:00','HH24:MI:SS') as shft from dual)
  2  --
  3  select to_char(trunc(sysdate)+(shft-out),'HH24:MI:SS') as diff
  4* from t
SQL> /

DIFF
--------
00:10:00

If you want something different, please report the details according to the FAQ: {message identifier: = 9360002}

Tags: Database

Similar Questions

  • How to set the clock for the hours, minutes, and seconds with Windows XP

    How to set the clock for the hours, minutes, and seconds with Windows XP

    I don't know of your question.  If you ask how to show the clock in the tray system with hours, minutes and seconds, then download & run "Tclock Light".  Windows will not natively display the seconds.

    TClock Light: <> http://homepage1.nifty.com/kazubon/tclocklight/index.html >

    HTH,
    JW

  • How to get the string (specified by row and column) of txt file with labview

    Hello world

    How to get the string (specified by row and column) of txt file with labview

    THX

    As far as I know, a text file has no column.  Be more specific.  Do you mean something like the 5th word on line 4, where the words are separated by a space, and lines are separated by a newline character?  You can read from the spreadsheet String function and set the delimiter to a space.  This will produce a 2D channels table.  Then use the table to index and give the line number and column number.

  • How to get the angles of view (horizontal and vertical) camera?

    How to get the angles of view (horizontal and vertical) camera?

    The horizontal and vertical field of VIEW properties are available with the camera_get_physical_property() function.

    Who is using the C API of the photo. I don't think that you can access by using the control of the camera of Cascades.

  • How to get the specific information of hardware and software data center

    How to get the specific information of hardware and software data center with powercli...

    What kind of information you need?

    No matter what Esxi host hardware info., if so could below thread is useful.

    Information about the host material with information on the nic and HBA drivers

  • How to get the time of the device

    Hello

    I'm developing an application in which I send location of the device in lat, long for every 10 minutes.  I want to send some time also with lat, long. This time must be peripheral situation updates for every 10 minutes.  Can someone tell me how do I do this?

    It is not obvious to your OP exactly what you ask.

    Ask you in a certain way a consistent recording time no matter what time zone are you in?

    Or are you just asking how to get the date and time?

    If it's the last QDateTime is one of the ways to get the date and time...

    http://developer.BlackBerry.com/native/reference/Cascades/QDateTime.html

    If you ask for the first answer more complex, you will probably need to check the time against an external clock (say GMT) and then re-reading use the contact information you have saved to determine what the weather was (including a calculation of DST) at this point in this particular time zone.

    Relying on the phone to change accurately that it is time that you move in time zones will not give accurate results.

  • How to get the time based on the time zone?

    Hi all

    I try to get timestamp based on the time zone I assign in the computer... for example right now I m CA, if I change the time zone of the computer IS, and use time get Sec.vi, I always get time to CA.

    and not the ACC at EST time... How can I get the time according to the time on my laptop?

    Think I remember vaguely that LV reads this parameter when loading, then try to restart LV after changing the time zone and see if that helps.

  • How to get the time of browser in the project template

    Hello

    With Jdev 11.1.2.3

    How can I get the time to browsers in the model project?

    Groovy accesses the browser time?

    I have to do some calculations (based on the time of the browser) for each row returned by a query. I think it would work if I could get time to groovy browser because I was able to perform the calculation in the SQL of my View object.

    But I can't seem to find how to get browser in Groovy times? Any ideas?

    The other option, is to use JavaScript to get the date of the browser, that should work, but the lines are displayed from a query in an AF:table, I need to apply the calculation to set the color of the table date field based on the calculation of date browser. So a java method should run for each row returned and displayed in the table.

    What senses seem to better you experts? I seem to be in a catch 22 here... Any ideas? And there are items that you can reference?

    Thanks for the help.

    Published by: 966952 on March 11, 2013 05:41

    As I said, you can set the inlinestyle of the field you want to change the background of a method of bean that return a style as appropriat

    // Bean code: the bean is set as requestScope bena in adfc-config.xml
    import javax.el.ELContext;
    import javax.el.ExpressionFactory;
    import javax.el.ValueExpression;
    
    import javax.faces.application.Application;
    import javax.faces.context.FacesContext;
    
    public class TableInlineStyleBean
    {
        public TableInlineStyleBean()
        {
            super();
        }
    
        // get a value
    
        private Object  getValueExpression(String name)    {
            FacesContext facesCtx = FacesContext.getCurrentInstance();
            Application app = facesCtx.getApplication();
            ExpressionFactory elFactory = app.getExpressionFactory();
            ELContext elContext = facesCtx.getELContext();
            ValueExpression lCreateValueExpression = elFactory.createValueExpression(elContext, name, Object.class);
            return lCreateValueExpression.getValue(elContext);
        }
    
        public String getCalculateStyle()    {
            //use expression from table or any other EL to do the calculation
            String val = "#{row.CommissionPct}";
            Object obj = getValueExpression(val);
            String color = null;
            if (obj != null)        {
                Number n = (Number) obj;
                // return red as background if CommissionPct > 0.2
                if (n.floatValue() > 0.2)
                    color = "background-color:Red;";
            }
            return color;
        }
    }
    

    And in the af: table a column (for example CommisionPct)

                                
                                    
                                
    

    Timo

  • How to get the time since January 1, 1970 in chain November 19, 2011 21:30

    I need to get the time from 1 jan 1970.I needs time in milliseconds of the chain (November 19, 2011 21:30). This string, I'm the webservice.i need to convert milliseconds to the requirement of the application. Is it possible to do so. Please help me

    Thank you

    splits the string to create a calendar and set its fields to the values of the substring.

    httpdateparser is very particular about the format. and internal it does the same thing as a manual scan would do, I suppose.

  • How to get the part of string before and after a character

    Hi all

    How to get the string before and after the comma character)

    Ex: The string contains the value John Kennedy

    I need the output as first stirng - John

    Second stirng - Kennedy

    Create table names (fullname varchar2 (20));

    insert into values of names ("John, Kennedy");

    insert into values of names ("papa ibra, Shan");

    insert into values of names ('Don Bosco'),

    Select * from names;

    Expected results

    FullName firstname lastname

    John, Kennedy John Kennedy

    Nicolas, Nicolas Shan Shan

    Don Bosco Don Bosco

    Please let me know how to proceed

    Thank you

    Hello

    This proves what I said before, on 0 and several commas commas.

    If we add these 3 rows to the sample data you posted:

    insert into names (fullname) values ("tou").

    insert into names (fullname) values (' David, Lloyd, George ");

    insert into names (fullname) values ('J, R, R, Tolkien");

    then the query I posted earlier produced these results:

    FULLNAME FIRSTNAME LASTNAME

    -------------------- -------------------- --------------------

    John, Kennedy John Kennedy

    Nicolas, Nicolas Shan Shan

    Don Bosco Don Bosco

    TOU tou

    David Lloyd, George David Lloyd, George

    J, R, R, Tolkien J R, R, Tolkien

    If you prefer to get these results:

    FULLNAME FIRSTNAME LASTNAME

    -------------------- -------------------- --------------------

    John, Kennedy John Kennedy

    Nicolas, Nicolas Shan Shan

    Don Bosco Don Bosco

    TOU tou

    David Lloyd, George David, Lloyd George

    J, R, R, J, R, R Tolkien Tolkien

    then you just change line 1:

    WITH got_commapos AS

    (

    SELECT FullName

    , INSTR (fullname, ','-1) AS commapos-* CHANGED *.

    Names

    )

    SELECT FullName

    , SUBSTR (fullname, commapos 1, -1) AS a first name

    SUBSTR (fullname, commapos + 1) in the FORM name

    OF got_commapos

    ;

  • How to get the channels spot given colors and spot channels length

    File is CMYK format... channel spot color is CMYK we as a spot channel color is c100m50y20k5
    How to get the channel spot color data using javascript? c = ? m = ? y = ? k = ?
    howv to get your channel length n (not the CMYK channel) use javascript?  such as CMYK + spot n-channel 7 = 7

    Please help me

    #target photoshop

    var myDoc = activeDocument;

    var channel = myDoc.channels;

    var number = 0;

    for (var m = 0; m< channels.length;="" m++)="">

    If (channels [m] .kind == ChannelType.SPOTCOLOR) {the number ++}

    };

    Alert (the number + "spotchannels");

  • How to add days, hours, minutes and seconds to a date?

    Hello

    I have the following problem.
    Saw 4 integers D, H, M, and S (each of them can be negative) and a date Da, I want to add days D, H hours, M minutes and seconds of S date Da.
    For example, if
    Da= to_date('28/06/2011 14:50:35','dd/mm/yyyy HH24:mi:ss'), and D = 3, H = -2, M = 20 and S = -12, 
    This means that I want to add 3 days, -2 hours, 20 minutes and -12 seconds to the date Da, and the new date must be in the following date:
    to_date('01/07/2011 13:10:23','dd/mm/yyyy HH24:mi:ss') 
    Is it possible to write a query for this problem or should I use PL/SQL?

    Thank you.

    There is no need of PL/SQL

    SQL> alter session set nls_date_format = 'DD/MM/YYYY HH24:MI:SS';
    
    Session altered.
    
    SQL> var d number
    SQL> var h number
    SQL> var m number
    SQL> var s number
    SQL> exec :d := 3; :h := -2; :m := 20; :s := -12
    
    PL/SQL procedure successfully completed.
    
    SQL> select to_date('28/06/2011 14:50:35','dd/mm/yyyy HH24:mi:ss')
      2     + :d
      3     + (:h / 24)
      4     + (:m / 24 / 60)
      5     + (:s / 24 / 60 / 60)
      6  from dual;
    
    TO_DATE('28/06/2011
    -------------------
    01/07/2011 13:10:23
    
  • How to get the time in UTC?

    Hi all

    8.6.1 LV + Windows XP SP2

    Over the last weekend, my code went to error because currently changed to summer time. This issue could be very easy, but I can't find a solution. How can I get the current time in UTC? For example, if the local time is 14:30 (+ 2: 00, winter time) my code display time 12:30 UTC. When I change the day after the last Sunday of may I get the same result. Because daylight saving time is the time of 14:30(+3h,_summer_time) should be 11:30. I also want to convert time to timestamp control...

    BR, Jim

    This link will help you:

    Get the Offset of UTC (Universal Time Coordinated) for a Timestamp in LabVIEW

  • How to get the time of the browser - redhat jdev 11.1.2.3 5.8

    Hello:

    In java, I need to calculate the number of hours difference bewteen the browser time and time on the weblogic server. Any ideas?

    Note: the browser may be located throughout the world. What expert methods do you use to deal with these problems of timezone?

    Thank you very much.

    You can try to use a javascript method on the page what Girard customers time and send it to a listener side server where you can compare both.

    
    
      
      
        
          
            function clientMethodCall(event) {
                var datetime = new Date();
                component = event.getSource();
                AdfCustomEvent.queue(component, "customEvent",
                {
                    payload : datetime
                },
    true);
                event.cancel();
            }
          
          
            
              
              
                
                  
                    
                    
                  
                
                
              
            
          
        
      
    
    

    and the listener side Server (JSServerBean.java)

    package de.hahn.blog.xxyyzz.view.beans;
    
    import oracle.adf.share.logging.ADFLogger;
    import oracle.adf.view.rich.render.ClientEvent;
    
    public class JsServerBean {
        private static ADFLogger logger = ADFLogger.createADFLogger(JsServerBean.class);
        public JsServerBean() {
        }
    
        public void customEvent(ClientEvent clientEvent) {
            // Add event code here...
        }
    
        public void handleRequest(ClientEvent event) {
            logger.info("Information:"+"---" + event.getParameters().get("payload"));
        }
    }
    

    Timo

  • How to get the time to date?

    Hi Sir,

    I need to recover the time to date.

    ' like ' 2012-10-03 04:32.

    to retrieve the only time where it's 04:32

    What is the query for this?

    Thank you

    Hi user,

    You can use TO_CHAR function to obtain the hour alone

    SELECT TO_CHAR (TO_DATE ('2012-10-03 04:32:00', 'YYYY-MM-DD HH24:MI:SS'),
                    'HH24:MI:SS'
                   ) TI_ME
      FROM DUAL
    

    Thank you
    Shankar

Maybe you are looking for