Type conversion from numeric value to time format

hi guys,
i hvae column called (Time in seconds).i need to convert the numeric value of one column into time format HH:MM:SS. for example 3012 =00:50:12.
how can i proceed the same in the front end.
Thanks & Regards,
Nandu

Hi..
here is the code.. (assuming 10000 in the following code is your seconds, replace that with your value...)
cast(TRUNCATE(10000/3600,0) as varchar(2)) || ' : ' || cast(TRUNCATE(60*((10000/3600)-(TRUNCATE(10000/3600,0))),0) as varchar(2)) || ' : ' ||cast(60*((60*((10000/3600)-(TRUNCATE(10000/3600,0))))-(TRUNCATE(60*((10000/3600)-(TRUNCATE(10000/3600,0))),0))) as varchar(2)) You can also use floor instead of truncate...
Above will give only h:m:s format if hh (or) mm (or) ss are between 0 and 9. So, you may need to add case when condition before each concatenation: if hh is between 0 and 9 then need to concatenate with 0 else the same code...
Thanks...

Similar Messages

  • How can change numeric value to date format? example value 1070131(CYYMMDD)

    in the datatable can i change numeric value to date format . in database date value is like 1070131 (CYYMMDD). I want to see 31/01/07(DD/MM/YY) or 31 Jan 07 . Is it possible?
    Thanks,

    Did you solve your problem?

  • Data type conversion from packed to numeric

    Hi Experts,
    i have a question on data type conversion. My requirement is:
    i have fields of type packed decimal in my internal table itab. I need to convert the values of packed decimal fields in itab to numeric type.
    Example:
    Data: begin of itab occurs 0,
                ebeln like ekko-ebeln,
                ebelp like ekpo-ebelp,
                menge(15) type p decimals 2,
                netpr(15) type p decimals 2,
              end of itab. 
    if itab-menge has a value of 2.00, i need to convert that value to '         200'.  Right justified.
    if itab-netpr has a value of 1,234.56, i need to convert that to '         123456'.
    The above internal table itab is passed to the Function module GUI_DOWNLOAD and the itab data is downloaded to a text file.
    Please let me know how to acheive this objective.

    Hi ,
    You can use
    SPLIT at '.' into v1 v2
    concatenate v1 v2 into vv1.
    REPORT ZDN_TEST_001 .
    data: lv_var1(15) type p decimals 2 value '123.00'.
    data: lv_var2(15) type p decimals 5 value '123.12121'.
    data: lv_varc1(15) type c.
    data: lv_varc2(15) type c.
    data: lv_varc1d(2) type c.
    data: lv_varc2d(5) type c.
    data: lv_varc11(15) type c.
    data: lv_varc21(15) type c.
    write:/ lv_var1.
    write:/ lv_var2.
    *1)write & REPLACE.
    write lv_var1 to lv_varc1.
    write lv_var2 to lv_varc2.
    REPLACE '.' WITH SPACE INTO lv_varc1.
                 CONDENSE lv_varc1 NO-GAPS.
    REPLACE '.' WITH SPACE INTO lv_varc2.
                 CONDENSE lv_varc2 NO-GAPS.
    write:/ lv_varc1.
    write:/ lv_varc2.
    *2)split & concatinate
    write lv_var1 to lv_varc1.
    write lv_var2 to lv_varc2.
    split lv_varc1 at '.' into lv_varc1 lv_varc1d.
    concatenate lv_varc1 lv_varc1d into lv_varc11.
    split lv_varc2 at '.' into lv_varc2 lv_varc2d.
    concatenate lv_varc2 lv_varc2d into lv_varc21.
    write:/ lv_varc11.
    write:/ lv_varc21.

  • How to pass a numeric value without its format to a subsequence?

    I have a sequence with a numeric parameter that is interpreted as a 16-bit bit mask. The numeric format of the parameter of that sequence is therefore "%#.16b".
    I also have a Sequence Call step in a second sequence (in the same file) that calls this first sequence. That second sequence passes literal values for that bit mask in the Sequence Call. My specific problem at this point is that, while debugging, I don't see the parameters in the numeric format I explicitly specified for them, but rather in one of three possible formats:
    - Literal values seem to come with a "system"-wide (maybe sequence-file-specific?) default format, which is decimal instead of binary.
    - Variable values (e.g. from the Locals) have their specific (and also explicitly defined) numeric format, which can be anything instead of binary.
    - If I don't pass a value but use the parameter default, this default is shown in the parameter's actual numeric format, binary. This is the only case that works as intended.
    How do I get the parameters to *always* keep the numeric format I specified for that sequence?
    The attached file tries to reproduce the problem and the intended result using only Sequence Calls and Message Popups. My version is TestStand 3.1f1.

    I just want to debug my subsequence and see its parameter represented as "0b0000000000011010" when I supply a literal value of 26.
    Ok, I try to be more explicit and show my problem using your suggestion: (The resulting sequence file is attached.)
    - Create a new sequence file.
    - Insert a new sequence "Sequence".
    - In "Sequence", create a parameter "Parameter" of type "Number".
    - Change the numeric format of "Parameter" to Binary with a minimum of 16 digits and *without radix*, ie. "%.16b". (In the other sequence file I used "%#.16b".)
    -> Intention: I want to see the supplied parameter value in this numeric format when debugging or converting to a string using Str().
    - Still in "Sequence", create a local "Local" of type "Number".
    - Change the numeric format of "Local" to the same as above, "%.16b".
    -> Intention: I want to demonstrate your way here, which actually works (I can use it as the "reference string" of the yet-to-be-defined message box), but does in an indirect way what I want to do directly using only sequence parameters.
    - Insert a "Statement" step in "Sequence".
    - Of "Statement", "Edit Expression" and use "Locals.Local = Parameters.Parameter" as the expression.
    - Insert a "Message Popup" step in "Sequence".
    - Of "Message Popup", do "Edit Message Settings", and use the following expression as the Message Expression:
    "I have this: " + Str(Parameters.Parameter) + "\n" +
    "I want this: " + Str(Locals.Local)
    - Insert a "SequenceCall" step in MainSequence.
    - Point "SequenceCall" to sequence "Sequence" of the current file and supply exactly the literal value 26 for the parameter.
    - In "MainSequence", create a local "Local" of type "Number".
    - Change the numeric format of this "Local" to something very dangerous, eg. "%9.16o".
    - Assign the exact numeric value 4616 to this "Local" variable.
    -> Intention: I want to demonstrate that there are cases where a propagation of numeric formats to subsequences can actually be more than a mere nuisance.
    - In "MainSequence", insert a second Sequence Call step, "SequenceCall_2".
    - Let "SequenceCall_2" call the same sequence "Sequence", but supply Locals.Local for the parameter.
    - Now run the sequence file in "Single Pass" mode.
    - In the first popup, you see that I get the (binary!) representation 0000000000011010 only for the local variable, but I also want it for the parameter value.
    - In the second popup, you see that I get the (octal!) representation 0000000000011010 for the parameter value, which would be correct (for what I want) if I had supplied the decimal literal 26 again. You see that the binary representation is something entirely different here!
    I hope you now get the point. Thanks for answering!
    Attachments:
    numeric-format-02c.seq ‏35 KB

  • Difficulty with Format Value for Time Format

     I have a vi where the current time is split out of an Analog waveform (using Get Waveform Components), and subtracted from a starting time, to result in  a relative time since the test began.  This may not be the most elegant way of doing it, but it works great.  The problem is that when I try to convert the elapsed time in seconds back to a time format for saving to a spreadsheet, I get the results shown by the probes.  In case the screen capture is not clear enough, the format string is     %<%H:%M:%S>t.  A colleague has tried this format and it works great. He's running 8.2, and I'm running 7.1.  Other than that, our applications appear identical.  Any ideas? 
    Attachments:
    Screen Capture2 of Time Format for HTV.png ‏17 KB

    I'm also on 8.2 and it works fine for me. Maybe format value couldn't handle time format codes in 7.1. I'm not really sure and I don't have it installed to check. Why don't you use "Format into String" instead? It will work the same way, and should work fine with 7.1.

  • During export from Discover to Excel, Time Format changes to Number Format

    Hi
    I have a seconds column which is of number datatype. But in my report, I am converting the number in *0HH:MI:SS* format. For example, I have *4952534 seconds*. So my report is showing *1375:42:14* which is a Time Format. It looks good when I view the data in Discoverer Viewer or Plus. But when I try to export the data to Excel, the time format gets converted to *4952534 seconds*, which is creating problems. So can you suggest on how can I preserve the formatting during export to excel from discoverer.
    Thanks
    Sachin

    Hi,
    Excel will not implement the 0HH:MI:SS data format, it just gets the field as a number. You will have to format the field into text using the calculation from my previous post.
    Rod West

  • Percentages from Numerical Values Assigned to Text

    I am new to Excel and am having trouble with what I thought would be a simple formula.  I am trying to create a formula that will find the percentage of text in a single column.  Example, I am looking for the percentage of "Yes" to "No"
    values in a column, and am not sure if I should assign a numerical value and then try and create a formula that will calculate the percentage. I have had no luck so far, any help would be much appreciated.

    Assuming the yes/no values are in column A, the following formula with give the percentage of 'yes' entries in that column:
    =COUNTIF(A:A,"yes")/COUNTA(A:A)*100
    If you format the result as %, omit the *100.
    Cheers
    Paul Edstein
    [MS MVP - Word]

  • Analogue Output from Numeric Value

    I have a VI which converts a digital signal into a speed based on the number of pulses per revolution. What I would like to do is now output that numeric value as a scaled 0-5V channel. I have tried to use the DAQassistant as with all of my other analogue outputs but it gives a buffer error. I know it can't be that hard to implement, can someone point me in the right direction...
    Thanks,
    Richard

    Thanks
    Files are attached save under version 11.0/
    Attachments:
    MeasureFreqandGraphSpeed.vi ‏13 KB
    ObtainSpeed.vi ‏23 KB

  • SharePoint 2013 Document Conversion from PDF to Word (docx) format

    Hello all,
    I know that SharePoint has the facility to convert documents from Word to PDF using the Word Conversion Service, and I've worked with it in C# using the object model.
    We have a client request for the opposite process. They have an email-enabled document library that receives PDF documents...they would like these converted to Word (.docx).
    I'm believe that SharePoint 2013 Word Automation Service has no way to do this (although I could be wrong); and I'm not sure of the object model either. However, in Office Web Apps you can open a PDF file in the browser, and the form has a button labeled
    "Edit in Word". When selected, it shows a message: "Word Web App will make a copy of your PDF and convert it to a Word document for you to edit."
    Is there a way to access the SharePoint Office Web Apps object model/API in code, to do the same thing that the "Edit in Word" button does? It would be great to be able to hook into those methods, if possible.
    Thanks for your help.
    Kind Regards,
    Kevin Worthington, Senior Consultant
    Sogeti USA

    Hi,
    According to your post, you want to convert the pdf file to word format.
    For converting the pdf file to word format, a workaround is that you can read the content of PDF file out and then construct a Word document using C#.
    Here are some detailed articles about how to read content from pdf file using C#
    http://jadn.co.uk/w/ReadPdfUsingCsharp.htm
    http://social.msdn.microsoft.com/Forums/en-US/4a9fb479-b48e-4366-ad39-02b2dac674f5/read-pdf-content-into-text-file-using-cnet
    http://www.codeproject.com/Tips/387327/Convert-PDF-file-content-into-string-using-Csharp
    Here are some detailed articles about how to create docx file using C#:
    http://www.codeproject.com/Articles/660478/Csharp-Create-and-Manipulate-Word-Documents-Progra
    Best regards

  • Date conversion from Excel to the SAP format

    Hi,
    I have created a BDC program which uploads daat from Excel sheet.
    There is a date field also, the format of which can be any as per the end user (it will be one of those allowed by SAP).
    However, the file will be used for execution by another user who may have a date setting which is different than that from the one in Excel.
    Eg. End User's date format: DD.MM.YYYY, SAP User's date format: MM/DD/YYYY
    So, how do I convert the date format from excel to the format which will be accepted by the transaction during the recording?
    Regards,
    Dave

    Hi Dave,
    I have faced the same issue while uploading the date to the bdc.
    if ur date format is DD.MM.YYYY in the excel file, first of all you need to change this to dats format ie YYYYMMDD ie character8 format and pass to the bdc, it will automatically convert to sap format
    ie you need to convert splitting at .
    data lv_date type char10,
            lv_dd type char02,
            lv_mm type char02,
           lv_yyyy type char04,
    v_date type char08.
    lv_date = '30.12.2011'.
    split lv_date at '.' into lv_dd lv_mm lv_yyyy.
    if strlen(lv_dd) lt 2.
       concatenate '0' lv_dd into lv_dd.
    endif.
    if strlen(lv_mm) lt 2.
       concatenate '0' lv_mm into lv_mm.
    endif.
    concatenate lv_yyyy lv_mm lv_dd into v_date.
    "Please use the variable V_DATE to populate to ur bdc"
    Edited by: Rahul Babukuttan on Aug 11, 2011 5:35 PM

  • Conversion from Robohelp 9 to Wiki format

    Greetings!
    I've searched online and in the forums for an answer to this question, but almost everything is dated 4 to 5 years ago. Hopefully, it's time to start talking about this again.
    I've just realized that when my client asked for a web-based Online Help system, what he really meant is Wiki-based Help system. I have TechComm Suite 3.5, which means I've got Frame 10 and RoboHelp 9.
    I've found a couple of references to the MediaWiki and its tool to convert RoboHelp 8 topics to wiki format, but there's nothing about RoboHelp 9. Is it still compatible? Why does RoboHelp not have Wiki as a publishing format since some of the most popular applications have moved away from the online help format and into the knowledge-based, wiki format?
    So my question is: is there a way to use Frame 10 or RoboHelp 9 to create a wiki-based Help system, or does the MediaWiki tool still work with RoboHelp 9 and does anyone have any experience with it?
    JD Hickey
    Documentia Inc.
    www.documentia.ca

    Hi there
    If a wiki is what you want, why are you using RoboHelp?
    RoboHelp doesn't "do" wiki and anything it creates will most certainly have to be converted. Once converted, RoboHelp wouldn't be able to use it again and you would have to start over.
    Cheers... Rick
    Helpful and Handy Links
    RoboHelp Wish Form/Bug Reporting Form
    Begin learning RoboHelp HTML 7, 8 or 9 within the day!
    Adobe Certified RoboHelp HTML Training
    SorcerStone Blog
    RoboHelp eBooks

  • Need information for file type conversion from Oracle

    Hi,
    I need a scenario where there is third party tool which supports file types (.lnb (Link Notebook Chart),.anb(Analyst Notebook Analytical Chart),.anx(Analyst Notebook Exchange Chart),.tcv(Text Chart Visualisation))
    I am having a Oracle database where I want to create a file from a Table so that the third party tool could understand
    the file supported types.
    Any help will be benefitial for me
    Thanks and Regards

    Hi,
    If I use as:
    DECLARE
    fileHandler UTL_FILE.FILE_TYPE;
    BEGIN
    fileHandler := UTL_FILE.FOPEN('test_dir', 'test_file.tcv', 'W');
    UTL_FILE.PUTF(fileHandler, 'Writing TO a file\n');
    UTL_FILE.FCLOSE(fileHandler);
    EXCEPTION
    WHEN utl_file.invalid_path THEN
    raise_application_error(-20000, 'ERROR: Invalid PATH FOR file.');
    END;
    If I use the file naming convention i.e extension type as .tcv will it support ?
    Thanks and Regards

  • Dynamic Data Type declaration from Parameter value

    Hi,
      I have a silly question..
    Is it possible to dynamically declare a variable based on the contents of a parameter...like:
    Tables: RSDUPD.
    Parameter: p_Daty like RSDUPD-DATU
    Data: l_last_day like (p_Daty)
    Thanks

    ok....thanks for the answer but its time to make the question harder. 
    I have the following code:
    DATA: it_query_results TYPE REF TO data.
    PARAMETER: prxy_cls(30).
    CREATE DATA it_query_results TYPE STANDARD TABLE OF (prxy_cls).
    ASSIGN it_query_results->* TO <l_it_query_result>.
    ....I do all sorts of processing with <l_it_query_result>.....then
    CALL METHOD o_query_result->execute_asynchronous
        EXPORTING
           output = <l_it_query_result>.
    only problem is method execute_asynchronous doesnt expect a type ref and only expects table type ZBWCOPA9030V00_QUERY_RESULT1...which is what I am entering in the parameter prxy_cls..
    need help badly..
    thanks

  • Conversion from higher value to lower

    Hi,
    I have a variable of dec type length 17 which i need to copy in variable of type dec with length 16. Please let me know the shotest solution for the same.
    <REMOVED BY MODERATOR>
    Edited by: Alvaro Tejada Galindo on Feb 12, 2008 10:48 AM

    I don't think you can use offsets with packed fields.
    I would just check to make sure the amount in the source field is not too large for the destination and then if it's not, just do a MOVE.
    Rob

  • Data type conversion from bigint to varchar

    Hi all,
    I need an advice from experts around here..what is the best and quickest option to do this task?
    I have  a table  with 10 columns - size of table is nearly 750gb with 25 partitions/Filegroups with (atleast 150 millions row in each partitions roughly)  Index size is around 150gb
    I have a task to convert one of column from  bigint to varchar
    could you please suggest me best possible advice.
    Thanks

    Can be very problematic... If the column is a part of the index you need to drop index first, issue ALTER TABLE to change the datatype and then create an index again,
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

Maybe you are looking for

  • Dynamic gallery with 3 columns and 5 rows with paging

    guyz, i am new to spry and i need your help. i want to create a dynamic gallery with data source as xml. i want to create a gallery with 3 columns and 5 rows.Basically a wallpaper page where there would be 15 wallpapers in a page with a link of downl

  • SCM, APO and EWM

    Hi Experts, My apology if I'm posting this on the wrong category. I'd like to ask for SAP SCM (APO, EWM etc) if its a separate installation like with SAP ECC or it can be added as one of the components for SAP ECC? Cheers, R-jay

  • Suport for Leica D-Lux 4?

    Hello, Does anyone know when there is likely to be support for the Leica D-Lux 4 camera's RWL files? TIA. - Vikas

  • Bessel function best fit

    Hi all, Quite new to LabVIEW. I am capturing diffraction images that are described by Bessel J functions. The maxima of the diffraction correspond to the maxima of the Bessel J functions ( or zeros of 1st derivative).  I wish to fit the diffraction i

  • FCE Timecode

    Is it possible to bring in SPBeta w/ timecode using FCE and have the SPBeta timecode tagged to the import through FCE? Mahalo for any clarity on this.