How to add varchar which is in time format

Hello Team,
can you please help me for the below request?
I have two columns (start and End) which is in varchar type and value is in time format as below. now I wanted to do some addition/subtraction based on condition. while adding or subtracting, it should be considered as time. Thanks in advance.
if start>end then start-End
else end-start
end if
  start                End
23:20:03            00:20:01 
23:37:15            00:37:13 
23:20:26            00:00:02 
23:47:06            00:10:26
00:13:23            00:07:31 
01:23:02            00:52:25

with
times as
(select '23:20:03' start_time,'00:20:01' end_time from dual union all
select '23:37:15','00:37:13' from dual union all
select '23:20:26','00:00:02' from dual union all
select '23:47:06','00:10:26' from dual union all
select '00:13:23','00:07:31' from dual union all
select '01:23:02','00:52:25' from dual
select start_time,end_time,
       to_char(trunc(sysdate) + case when to_date(start_time,'hh24:mi:ss') >= to_date(end_time,'hh24:mi:ss')
                                     then to_date(start_time,'hh24:mi:ss') - to_date(end_time,'hh24:mi:ss')
                                     else to_date(end_time,'hh24:mi:ss') - to_date(start_time,'hh24:mi:ss')
                                end,
               'hh24:mi:ss'
              ) diff      
  from times
START_TIME
END_TIME
DIFF
23:20:03
00:20:01
23:00:02
23:37:15
00:37:13
23:00:02
23:20:26
00:00:02
23:20:24
23:47:06
00:10:26
23:36:40
00:13:23
00:07:31
00:05:52
01:23:02
00:52:25
00:30:37
Regards
Etbin
Oops! Should have looked before posting.

Similar Messages

  • How to add customized column in the time sheet CATS (transaction CAT2) ?

    Hello,
    I need to be able to add some columns in the time sheet CAT2 containing:
    - the name and first name of the person (in addition of the number), in display mode in the CATS time sheet.
    - a  text that I will found by reading some tables and values...
    Does anyone have any idea how to do so ? and if it's possible or not?
    Thanks a lot in advance for your help.
    Best regards
    Fanny GROUX

    Hi,
    Thanks a lot, it's really help...don't know why I didn't see this customized point before in SPRO.
    But I have an other issue, my new fields is added in the CATS screen and now I'm trying to put default value by using the user exit of extension CATS0009.
    When I complete the value of my new fields in structure CATSD_IMP, there are not taking into account and the CATS screen doesn't display the value.
    Am I using the wrong table ? wrong user-exit ? or my code ..
    Thansk a lot again for your help.
    Fanny GROUX

  • How to add hours to a reference time cell??

    I am making the switch to Numbers from Excel and can not figure this out.
    I have one cell as a time : 10:00 AM - A1
    In Cell B4 I want 10:00 AM plus 6 hours.
    I can't figure this out ! In Excel I would out , =A1+"6:00"
    Not sure if the cells are formatted incorrectly but I have tried all the date and time formats.
    HELP!
    Thank you

    In the future it would be best to post your three additional questions as three new topics. Don't worry about whether anyone will look at them. This is a very active discussion area.
    1. Is there a toolbar or keystroke short cut to merge cells? I see it in the menu bar but need a shorter option
    Yes, you can make your own custom shortcut. Go to the Keyboard section of System Preferences. I must say that I don't like merging cells in Numbers. It has the potential to get you into trouble and should be avoided. Having a shortcut just makes this evil more tempting, in my opinion. Numbers doesn't have the great need for merging cells that Excel does. You can make separate small tables in Numbers and you can give them descriptive names that will display above the tables, if you choose. You also can intersperse Text Boxes and Shapes with text in them to annotate your sheets. Merging cells isn't so imperative in Numbers as your past experiences my have led you to believe.
    2. If I want to reference another cell on another sheet can I name the cell that I wish to reference? Ie: Sheet 1 cell c4 , I would like to name : start, then in other cells I would write , =start. I can do this excel but no luck so far in numbers.
    Yes you can. There are two ways you can learn about this. First, you can insert a reference to a remote cell by navigating to it using the Sheets Pane and then clicking on the cell you want to reference. Then take a look at what Pages inserted for a reference. This will give you the format (syntax) for doing it manually. You can also learn about referencing remote cells by reading the Numbers User Guide PDF and the Formulas and Functions User Guide. Then are both available from the Help Menu for download.
    3. Move that sidebar menu to the bottom??
    No.
    Regards,
    Jerry

  • How to add CSV file extension in output format of sap document in SCOT

    Hello All,
    i have added CSV in conversion rule through “SAP Customizing Implementation Guide–> SAPNetWeaver –>SAP Web Application Server -> Basis Services -> Communication Interfaces -> SAPconnect Client-Wide Settings -> General Settings -> Conversion Rules”. but it is not showing in SCOT (o/p format for SAP document).
    Please do needful

    i found this string on net
    add a Conversion-rule (transaction SCOT like this:
    CSV CSV 1 SX_OBJECT_CONVERT_TXT_INT
    How i Add .

  • How to add a dollar sign $ to a formatted currency field

    Any idea how to add a $ sign to a formatted field?

    Hi Kim,
    Right click on the field and click on Format Field.
    In the !Format event type: $@_$_.
    This should place a $ before your output value.
    James.

  • How do you change the date and time format in Pages

    I've tried changing the date and time format a number of times for Pages but it does not change.  I'm going to the System Preferences/Language and Text and Formats.  I make the changes click on OK and go back to Pages.  NO change.

    Hi Uncle,
    Page 116 of the Pages'09 User Guide: Control Click the date, Edit Date and Time.
    Date and time can also be in a table. Format the table cell.
    The User Guide is well worth a read. Download it from the Help menu in Pages.
    Regards,
    Ian.

  • How to add a new HD to Time Capsules daily back-up

    So, i have a 1TB Iomega drive housing all my Time Machine back-ups. I also have an additional 1TB Iomega drive housing all my video/audio files. When Time Machine performs it's hourly back-up, it only checks the new items on my Mac Mini's drive. I have over 700GB of info on my Audio/Video drive that i want to be backed up by Time Machine....
    So.....i followed +/- instructions for adding/subtracting drives to NOT back up. Unfortunately, my Audio/Video drive that i want to have Time Machine back-up is not available. It is listed in my list of available drives, but its name is shaded, and i can not click on it to either add/subtract from the list. I assume if it's not in dark, bold text, then it should be having Time Machine back it up hourly, right? Well, it's not. Does anyone know what the heck i'm talking about, and if so, how to solve this problem? It seems like a ridiculously easy thing to solve, but i've hit a wall. Any help would be GREATLY appreciated.

    comiconline wrote:
    That all said, i have an additional question. When Time Machine backs up your files, does that also include DELETED files? In other words, if i decide to delete a bunch of files on my Media HD, will Time Machine delete those files from the back-up drive, too, so that Time Machine only retins files that i CHOOSE to keep on my computer?
    Eventually it may delete them, but if TM did a backup while you still had those files on your Media HD (which I am assuming is being backed up by TM), it does retain the data on your backup drive.
    I don't want to have a ton of files taking up space on the back-up drive that i deleted from my Media HD.
    If you have no use for those files and want to delete them completely, just open Finder and click on the TM icon on the Dock. Locate the folder where those deleted files resided. Click on the files you want to totally delete. Click on the Gears button and select +Delete all backups of+ ---. The space taken up will not instantly be recovered, so you may not see a drop in backup size. Eventually TM will eat up that space, so don't worry about it.

  • How to add screen elements at run time on button click in Web Dynpro abap?

    Hello All,
    I have a requirement wherein the user wants to add the textbox dynamically at runtime on button click action. My questions is, Is it feasible to dynamically add screen elements at runtime? If yes, how?
    Please help.
    Thanks

    Hi Ajinkya,
    This is absolutely possible! Adding view elements at runtime is called "dynamic programming". There are a lot of good resources and tutorials on SCN if you do a search. To start you off, here is an excellent series by Thomas Szücs:
    Dynamic Programming in Web Dynpro ABAP - Introduction and Part I: Understanding UI Elements
    Dynamic Programming in Web Dynpro ABAP - Part II: Handling ViewElements
    Dynamic Programming in Web Dynpro ABAP - Part III: Aggregations and DDIC-Binding of ViewElements
    Another option that avoids dynamic programming is to create the view element at design time but bind its visible property to a context attribute of type WDUI_VISIBILITY. You could initially set its visibility to "none" until the user clicks the button, then you could change its visibility to "visible".
    Cheers,
    Amy

  • How to add certificate which to trust to E60 or to...

    Hello,
    I'm new with Nokia telephones and I have mostly used Sony-Ericcson so this is probably n00b question.
    I need to add our exchange servers certificate to our phones so that our phones would trust the server but the problem is that there is instructions to go to certificate management and to add/save the sertificate there etc. but how?... there is no option to add or save or anything which would suggest that sertificates even could be added.
    Second way was to open a webpage in this case it would be our OWA page and install the certificate by that way and again there is no way to save the certificate. Only to view and accept the certificate.
    Am I totally lost/stupid or what? =)

    Hello,
    I don't have the answer to your question, but I've noticed this blog dealing with a related subject (installing certificates to be able to connect to gmail without "untrusted certificate" errors):
    http://www.e-series.org/archives/46
    Maybe this will help you find the solution? I know I did follow those instructions and was able to install the certificates, so it appears to be technically possible to install new certificates...

  • Add varchar column in to Time Series Algorithm

    i created a time series algoritham using numeric columns, but i need to add text columns so what we do?
    plz share to me if possible to add.

    Hi,
    Thanks a lot, it's really help...don't know why I didn't see this customized point before in SPRO.
    But I have an other issue, my new fields is added in the CATS screen and now I'm trying to put default value by using the user exit of extension CATS0009.
    When I complete the value of my new fields in structure CATSD_IMP, there are not taking into account and the CATS screen doesn't display the value.
    Am I using the wrong table ? wrong user-exit ? or my code ..
    Thansk a lot again for your help.
    Fanny GROUX

  • How to add date in MM/DD/YYY  format at the end of a string

    Hi
    I want Description to look like
    ' PARTICIPATION ON TEMPORARY TV SHOW EXPIRING ' and include the "latest show expiration date" as "MM/DD/YYYY"
    Pls help ......
    try {
                            Date date= new Date();
                             System.out.println("THE TODAYS DATE is :"+date);
                               DateFormat df = new SimpleDateFormat("yyyy-MM-dd");
    //                         DateFormat df = new SimpleDateFormat("MM/DD/YYYY");   -----> Its not allowing this format ????????
                             begin_Date = hashDateE.get(id);
                             System.out.println("THE LATEST TV SHOW DATE is :"+begin_Date);
                             Date d1 = df.parse(begin_Date);
                             String relation;
                             if(d1.equals(date))
                                  relation = "both the dates are same";
                             else if(d1.before(date))
                                  relation = "BEFORE";
                             else
                                  relation = "AFTER";
                             //System.out.println(d1 + "is" + relation + ' ' + date);
                             if("10".equals(latestShow)){
                              if("BEFORE".equals(relation)){
                                   System.out.println("The latest show date is expired");
                              Code =3;
                              Description = "PARTICIPATION ON TEMPORARY TV SHOW EXPIRED ";
                              else if("AFTER".equals(relation)) {
                                   System.out.println("The latest show date is non expired");
                                  Code = 2;
                                   Description = "PARTICIPATION ON TEMPORARY TV SHOW EXPIRING" + d1; -------------> I TRIED THIS WAY ( d1 should be in this format MM/DD/YYY
                              }else {
                                   System.out.println("The latest show date is non expired");
                                 Code = 20;
                                  Description = "PARTICIPATION ON TEMPORARY TV SHOW EXPIRING" + d1;
                        

    If you have a string like 2008-12-15 and you want to interpret it as a date and format it as 12/15/2008, then you need two DateFormat objects.
    One to parse the String in the first format into a Date, -------> i could do this
    try {
              String begin_date = "2008-12-15";
              System.out.println("The begin date is :"+begin_date);
              DateFormat df = new SimpleDateFormat("yyyy-MM-dd");
              Date d1 =  df.parse(begin_date);
              System.out.println("the Date value is d1 :"+d1);
    catch() {
    }Output is :The begin date is :2008-12-15
    the Date value is d1 :Mon Dec 15 00:00:00 EST 2008
    Pls help me with the second part :- ?????/
    and one to format that Date into a String in the second format. MM/dd/yyyy --- how to do this ..after i tried several times with different statements , i am asking this piece of code to achieve this

  • How to add script editor webpart into xml format

    Hi,
    I need to add the script editor webpart on to my sharepoint page using this format :
    <AllUsersWebPart WebPartZoneID="WebPartZone6" WebPartOrder="1">
            <![CDATA[
          <webParts>
           <webPart xmlns="http://schemas.microsoft.com/WebPart/v3">
            <metaData>
               <type name="Microsoft.SharePoint.WebPartPages.ScriptEditorWebPart, Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" />
               <importErrorMessage>$Resources:core,ImportErrorMessage;</importErrorMessage>
            </metaData>
            <data>
             <properties>
              <property name="Title" type="string">$Resources:core,ScriptEditorWebPartTitle;</property>
              <property name="Description" type="string">$Resources:core,ScriptEditorWebPartDescription;</property>
              <property name="ChromeType" type="chrometype">None</property>
                  <property name="Content" type="string">
                       &lt;style type=&quot;text/css&quot;&gt;.header {;top: 100px;left: 10px;width: 100%;color:#ff8800!important;}.headerpara {;top: 140px;left:
    10px;width: 90%;color:white;}.image {;width: 100%;}.heading {;bottom: 10px;left: 20px;width: 85%;color: white!important;}&lt;/style&gt;
                  </property>
             </properties>
            </data>
           </webPart>
          </webParts>
            ]]>
    the webpart is successfully added to the page but when it renders it's css is not got applied on to the page instead the css gets render as a text which is :
    <style type="text/css">.header {;top: 100px;left: 10px;width: 100%;color:#ff8800!important;}.headerpara {;top: 140px;left: 10px;width: 90%;color:white;}.image {;width: 100%;}.heading {;bottom: 10px;left: 20px;width: 85%;color: white!important;}</style>
    i follwed the follwing link as an example :http://sharepointsnacks.blogspot.in/2014/02/sharepoint-2013-script-editor-web-part.html
    i am not sure is there anything which i am doing wrong but struggling a lot with this .
    Any help appreciated .
    Thanks

    Hi Avnish Gupta,
    Continue to Lakshmanan, you may need to add your CSS Styles in a <ContentLink> tag like below:
    <ContentLink xmlns="http://schemas.microsoft.com/WebPart/v2/ContentEditor" />
    </Content>
    More information:
    Adding content editor web part with default content through Visual Studio:
    http://spointdebo.blogspot.jp/2013/12/adding-content-editor-web-part-with.html
    Best regards
    Zhengyu Guo
    TechNet Community Support

  • How to add new tag in MT103 file format

    Hi All,
    We want to add new Tag 72, in MT103 file format.
    Shall i have to enhance with event module?
    or
    through DMEE tree
    Regards,
    MS

    Hi,
    You need to enhance the event module and have to add your tag in that function module programming.
    Regards,
    Gaurav

  • How to add two values

    How to add varchar values in oracle.Consider as both are time values.but the data type[both] is varchar and stroed in table
    For example:
    Column1 Column2
    2.40:10 PM 5:22:00
    i need the result for the following format
    8.02[8 hours and 2 minutes]

    with c as
    (select '2:40:10 PM' t1, '5:22:00 PM'  t2  from dual)
    select hr+level ||':'||to_char(mi - (level*60))||':'||sc Time from
        select  sum(h) hr,sum(m) mi, sum(s) sc from
            (select
                    substr(t1,1,instr(t1,':',1)-1) h, substr(t1,instr(t1,':',1)+1,instr(t1,':',2)) m, substr(t1,instr(t1,':',3)+1,instr(t1,':',3) - instr(t1,':',2)) s, substr(t1,-2) t
            from c
            union
            select
                    substr(t2,1,instr(t2,':',1)-1), substr(t2,instr(t2,':',1)+1,instr(t2,':',2)), substr(t2,instr(t2,':',3)+1,instr(t2,':',3) - instr(t2,':',2)), substr(t2,-2)
            from c
    connect by level<(mi-60)
    TIME
    8:2:10

  • SRM POWL - How to add/update longtext (internal note) of invoice

    created powl for mass approval/rejection of invoice
    For Rejection 'm adding 'reason for rejection' & 'internal note' fields
    Which i need to update in invoice --> notes & attachment --> 'reason for rejection' & 'internal note'
    I am doing it as --
    TRY.
             CALL METHOD lo_pdo_notes->add_longtext
               EXPORTING
                 iv_p_guid          = i_guid
                 iv_tdid            = 'NOTE'
                 iv_tdspras         = sy-langu
                 iv_tdformat        = 'X'
                 iv_text_preview    = 'Internal Note'
               CHANGING
                 co_message_handler = lr_message.
           CATCH /sapsrm/cx_pdo_abort .
         ENDTRY.
    TRY.
             DATA text_id TYPE tdid VALUE 'RREJ'.
             CALL METHOD lo_pdo_notes->add_longtext
               EXPORTING
                 iv_p_guid          = i_guid
                 iv_tdid            = text_id
                 iv_tdspras         = sy-langu
                 iv_tdformat        = 'X'
                 iv_text_preview    = 'Price Difference' " drop down value
               CHANGING
                 co_message_handler = lr_message.
           CATCH /sapsrm/cx_pdo_abort INTO lx_abort  .
    *          mo_cll_message_handler->set_a1bort( io_pdo_abort_exception = lx_abort ).
         ENDTRY.
    But message handler is returning Initial value  - & 'm unable to update it in invoice...
    Can you help ??

    Thanks Pedro  & Pradeep. I understand now how to add fields to SRM. Appreciate all your support. I have another question. I have to add fields to the following structures. Some structures have include structures and some does not. How to add fields which does not have include structures. Do I have to create my own Z include structure or any other way?
    Table                                           include structure
    1) BBP_PDIGP                           CI_BBP_ITEM
    2) BBP_PDHGP                          CI_BBP_HDV
    3) BBP_PDHSB                          <NONE>
    4) CRMD_ORDERADM_H            INCL_EEW_ORDERADM_H
    5) CRMD_ORDERADM_I             INCL_EEW_ORDERADM_I
    6) BUT000                                  INCL_EEW_BUT000
    7) BBP_PDPSET                        <NONE>
    8) ADDR3_DATA                        <NONE>
    9) BBP_PDISS                           INCL_EEW_PD_ITEM_SSF
    Look forward to hear from you.
    Thanks,
    GS

Maybe you are looking for

  • IPhone not syncing... I've deleted my iphone backup... Can I force iTunes to create a backup?

    Hi guys! First time poster. I've searched the web before posting. Hope you can help... iTunes has been telling me my iphone has been syncing, but when I looked at the date on the backup file, my phone backup file located here: ~/Library/Application S

  • .vsd application in SAP DMS

    Hi friends, I have .vsd application file to upload in SAP DMS. But SAP DMS does not supports this kind of application. What to do? kindly help me out. Regards, Punam

  • Implementing authentication for web services

    Hi all, I'm struggling trying to guess how to implement basic HTTP authentication as well as using certificates in order to apply HTTPS, for some web services we've created, running on the Oracle Application Server 10.1.12. The web services were impl

  • My podcast have not updated since may 7th in store.

    i have for 2 years downloaded the same 4 or 5 each day but all of a sudden none updated after the 7th dan patrick show espn shows email me if possible [email protected] thanks will

  • How can you share audiobooks in family sharing?

    We use Family Sharing in our family. But on the "purchase" items in iTunes on ipads and iphones there only appears Music, Films and TV Programmes. No Audiobooks. Did Apple just forget them or can I find them somewhere else?