Convert varchar to decimal HH

How can I convert varchar hh: mm (127:15) as a decimal (127,25)?

Jeff
SQL> with t as (select '127:15' str from dual)
  2  select to_number(substr(str,1,instr(str,':')-1))+
  3         to_number(substr(str,instr(str,':')+1))/60 dec
  4  from t;

       DEC
----------
    127.25

Max
http://oracleitalia.WordPress.com

Tags: Database

Similar Questions

  • Convert hexadecimal into decimal and keep the zeros on the left...

    Hello

    I hope you can help us?

    How to convert hex to Decimal and keep the zeros

    I read 002C, hex, and I want to convert it to decimal-0044.

    sscanf (MyNum, % '4 x', & DecNum); will only give me 44.

    It worked until I started having zeros.

    We will always have a 4 digit hexadecimal entry in a range

    We have the 00 leader in this case.

    How is this best?

    Thanks for the help

    Simon

    Hello

    I don't really understand your problem. Is this kind of things that you need?

    int main (int argc, char *argv[])
    {
        const char MyNum[] = "002C";
        int DecNum;
    
        sscanf (MyNum, "%4x", &DecNum);
        printf ("%04d", DecNum);
        getchar ();
    
        return 0;
    }
    

    '0044' appears on standard output when executing the printf function...

  • Readed hexadecimal string converted to a decimal number.

    Hello! I do a vi to check the hours of the lamp of my Sony projector. I send a hexadecimal command which is: A901 dignitaries 1301 0000 139 a senators. When the projector receives answer with 1901 1302 0031 339. 0031 corresponds to the data that I need to convert it to decimal because it tells me how many hours we used the lamp. How can I get this read-separated string to get only the third part of hexadecimal numbers converted to decimal? Thanks in advance!

    Hey rounded!

    As the data is in a format string, the hexadecimal number VI string should work well in this case.

    To enter only a single figure of this string to use in the hexadecimal number string VI, then I suggest using the string subset VI; Returns a specified segment of a string. By changing the offset of entry which determines which part of the string data is beginning to be analyzed from and changing the length to control the amount of characters to analyze, you will be able to enter the character that you want to convert.

    Kind regards

  • How to convert varchar to DateTime?

    Hi all

    I have a field - "final payment".

    Data - type Varchar.

    Last completion date must be in the date format. So I want to convert Varchar to Date.

    How can I convert? Can someone please help me solve this problem.

    Hi Nicolas,.

    Gayathri Venugopal wrote:

    I have a table - order and I have a field " Latest_Completion_Date " which is in the format Varchar - ' 20150804'.

    select Latest_Completion_Date from order 
    output- 20150804
    

    I want to convert Latest_Completion_Date - '20150804' in Date format - 15-SEP-07 ".

    How to convert it?

    The column ORDER. LATEST_COMPLETION_DATE with the VARCHAR2 data type?

    How are "Last date" element filling in the form?

    You can use to_date and to_char in combination to get the required format:

    select to_char(to_date(latest_completion_date,'YYYYMMDD'),'DD-MON-RR') latest_completion_date
      from order
    

    Kind regards

    Kiran

  • How to convert varchar to date datatype all insert or update in the table

    Hai All

    I need to convert to varchar type to date.

    I have two Tables T1, T2

    Structure of T1

    Code varchar

    Time varchar

    Date varchar

    Structure of T2

    Var EmpName

    Empcode var

    Date of the respondent

    Outtime date

    Intrinsically date

    Date of Introut

    Att_date

    Now I need to spend the time form T1 to T2 respondent, outtime, intrinsically, introut under certain conditions

    So now I need to convert Varchar to Date so that the insert or update

    I tried something

    Insert into T1 (code, respondent, att_date) values

    (To_date(Date|| dele de code temps, «hh24mi de mon-dd-yyyy»), att_date);

    OR update while

    Setting a day set Outtime T2 = To_date(Date||) Time, 'hh24mi mon-dd-yyyy') where...


    I got an error Ora-01861


    Concerning

    Srikkanth.M

    You did not show an example of your date or time values, control may be necessary to add a space between them, like

    To_date(Date || ' ' || time,'dd-mon-yyyy hh24mi')
    
  • Convert Varchar to Date of the

    Hello


    Im trying to convert varchar to date.

    So I used To_date (cilumn, 'DD-MM-YYYY'), since I have to order the set in descending order, I used the same function of conversion with order by clause.


    The problem is... put it is not ordered.


    < sql >

    Select date_created
    Of
    (
    Select distinct
    to_date(created_date,'DD-mm-YYYY') as date_created
    of schedule_backup
    )
    order by desc date_created
    /

    < sql >




    out put is
    =================




    DATE_CREA
    ---------
    26 NOVEMBER 09
    23 NOVEMBER 09
    19 NOVEMBER 09
    16 NOVEMBER 09
    11 NOVEMBER 09
    4 NOVEMBER 09
    30 OCTOBER 09
    11-SEP-09
    4 MARCH 10
    MARCH 1, 10
    FEBRUARY 25, 10

    DATE_CREA
    ---------
    FEBRUARY 22, 10
    17 FEBRUARY 10
    FEBRUARY 15, 10
    11 FEBRUARY 10
    FEBRUARY 9, 10
    FEBRUARY 3, 10
    27 JANUARY 10
    20 JANUARY 10
    JANUARY 15, 10
    JANUARY 4, 10




    Thank you
    REDA

    So it's a problem with the data itself

    Check below

    SQL>SELECT TO_CHAR(a,'DD-MON-YYYY')
      2        ,TO_CHAR(b,'DD-MON-YYYY')
      3    FROM (
      4          SELECT TO_DATE('03-FEB-10','DD-MON-YYYY')    a
      5                ,TO_DATE('03-FEB-2010','DD-MON-YYYY')  b
      6            FROM DUAL
      7         ); 
    
    TO_CHAR(A,' TO_CHAR(B,'
    ----------- -----------
    03-FEB-0010 03-FEB-2010
    
    Elapsed: 00:00:00.04
    SQL>
    

    Data are not in a consistent format DD-MON-YYYY or DD-MON-AA. It is a format of mix that impact of output as shown above

    Concerning
    Arun

  • How to convert numbers from decimal to binary in the Windows 7 calculator

    Hi how I can convcert numbers from decimal to binary using the calculator of windows 7

    1. launch the calculator
    2. click on 'View', then select 'programmer '.
    3. click on the 'Dec' option box on the left side.
    4. Enter your decimal number.
    5. click on the radio button 'Bin' to convert from decimal to binary.
    6. the binary number is displayed.

  • convert datetime to decimal format

    Does anyone know how to convert a datetime (as 2015-06-10 07:30) in a decimal number that is similar to:

    42165.450 where 42165's days and 450 is minutes?  If I try the following:

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

    < cfset dtNow = '2015-06-10' / >

    < cfset dtOne = CreateDateTime)

    Year (dtNow)

    Months (dtNow).

    Day (dtNow).

    07, <!--> 18:00

    30, <!---30 minutes. ->

    00 <!---0 seconds. ->

    ) / >

    <!-empty result. ->

    < cfdump var = "#NumberFormat (dtone, '99999.99999') #" / > < br / > ""

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

    I find myself with 42165.31250

    Thank you

    Padding with zero is not the answer. What you write in fact comme.720 et.1218 are, in fact, not decimals.

    As you suggested, 720 and 1218 values represent for several minutes. Thus, the duration, in minutes, for dates (2015 - 06-16 at 12:00) and (2015 - 06-16 at 20:18) are, respectively, 12 x 60 = 720 and 20 x 60 + 18 = 1218. You can solve the problem in 2 ways:

    1)

    Interpret values 42170 / 720 and 42170 / 1218, respectively, as 42170 + 720/1439 =42170.500 and 42170 + 1218/1439 =42170.846

    2)

    Take a step back to my last post. You can determine the date reset your system as follows.

    You know that the date (2015 - 06-16 at 12:00) equals (42170 days + 720 minutes) after the date of zero. Everything by converting the minutes gives (42170 x 24 x 60 + 720) = 60725520 minutes. You then

    Zero date: #dateAdd("n",-60725520,myTestDate) #

    This tells you that your zero date is 1899-12-30 23:00, which equals createDatetime (1899,12,30,23,0,0). You can then use that date zero as the basis for all other date calculations.

    Suppose you want to find a date corresponding to the format number_of_days / number_of_minutes, for example, 42170 / 1218. All you need to do now is convert everything in minutes and add to the zero date. Therefore,.

    #newDate #.

  • Convert inches to decimal value fraction

    I get a lot of information required Tin Fractions (12 11/16 in., 2 1/8 inches, etc..) Is it possible in illustrator to convert decimal values?

    In illustrator, most dialog boxes can do math, then, first of all make the fraction. 5/8 serait.625 then enter the 12 whole number before the comma 12,625

    That's assuming that the dialog box can not handle the whole number and the fraction at the same time.

  • How to convert varchar in timestamp

    "in the comic book, I have an indtalledDate of column with a varchar data type - and value is as ' Thu Dec 20 07:33:20 PST 2012." Now, I need to convert this format of timestamp-> 20 December 12 07.47.49.463000000 AM. How can I do?

    can someone pls help?

    Check this box:

    SELECT CAST (
              TO_TIMESTAMP_TZ ('Thu Dec 20 07:33:20 PST 2012',
                               'Dy Mon DD HH:MI:SS TZR YYYY') AS TIMESTAMP)
      FROM DUAL
    

    See you soon,.
    Manik.

  • Convert Exponenti to decimal number

    I need to convert an exponential number in decimal
    1E10^-5^
    to the number.

    I don't want to change this to TANK as I have to perform mathematical operations on the output.

    user13024762 wrote:
    Correct me if I'm wrong,

    Exponential to Decimal will be like

    1E10^-5^  to 0.00001
    

    So, what's the problem?

    SQL> select 1e-5 from dual;
    
          1E-5
    ----------
        .00001
    
    SQL>
    
  • CONVERT varchar into money

    Can someone help me with the syntax on how convert data type varchar data type money. I get the following error message:

    [Macromedia] [SQLServer JDBC Driver] [SQL Server] Denied the implicit conversion of the data type varchar data type money, table 'tableName', column 'columnName '. Use the CONVERT function to run this query.

    Any help would be appreciated! Thank you.
    SLL

    The error is caused by the use of single quotes around #form.price #. Single quotes tell sql server to deal with the #form.price # as a string (varchar) value. Although sql server can implicitly convert some values from one data type to another is not automatically converted to varchar in type money.

    Assuming that you have already validated the value #form.price #, get rid of the apostrophes or better to use cfqueryparam with the proper cfsqltype. (I think that's cf_sql_decimal)

    -It works
    Update @tblName
    fixed price = 10.00
    where id = 1

    -It works
    Update @tblName
    fixed price = cast (' 10.00 ' as money)
    where id = 1

    -It's not
    Update @tblName
    fixed price = '10 h 00'
    where id = 1

    -using the cfqueryparam
    Update @tblName
    package price =
    where id = 1

  • SQL: convert varchar in Silver (asp, vb, sql) data type

    Hello

    I'm doing a simple search form that takes a value priced max investment to a text field in a form that is then transmitted to a catalog page. On this page, I have a select query that includes a where clause condition for less than the value of the query string.

    A simplified version of the query is:

    «SELECT * from table when price < 'varPrice' "»

    When I run the present I get an error saying

    Microsoft OLE DB provider for ODBC (0x80040E14) drivers
    [Microsoft] [ODBC SQL Server driver] [SQL Server] Implicit conversion of the varchar data type money is not allowed. Use the CONVERT function to run this query.

    I googled this a fair bit and can't really find what I need to get started me - anyone able to point me in the right direction?

    Thank you very much

    You compare prices (money) to "varPrice' (text) and implicitly
    conversion between these two types is not allowed. You must explicitly
    CAST or CONVERT the column.

    In your case, I guess you don't really means for varPrice text. Lose
    the quotes and it will address a number.

    "tedstar" wrote in message
    News:eggr3h$old$1@forums. Macromedia.com...
    > "SELECT * from table where price»< 'varprice'="">

  • Convert a numeric decimal to Hex String 2 bytes

    Hello..

    I need to convert a numeric value between 0 and 2014 and convert 2 Byte HEX STRING.

    Example;

    Decimals: 1--> Hex - 0001

    Decimals: 255--> Hex - 00FF

    Decimals: 512--> Hex - 0200

    tried, but his work until only 511.

    Help, please.

    VI is attached...

    Hi Pascal,.

    Why don't post it your questions "convert x to y ' in one thread?

  • Convert String to Decimal for Zigbee on noncommunicable diseases

    Hello

    A brief overview of what I'm trying to do:

    I have a zigbee radio, attached to an AD1216 Committee of noncommunicable diseases. I also have an other zigbee hung as a serial in my computer. I need to send a write command from decimal number to the zigbee remote control and have it delivered in return the same data format.

    Problem: I can only send text data. I always make me hooked up with errors in the citation read the part of the code. I try "Typecast" but there are still errors. I need to send for example "254 33" and it must respond with "85" instead I think it sends to the format ascii or hex.

    I thank very you much in advance!

    Judging by (analog/AD1216 Digital Conversion orders), it doesn't look like those who are decimal numbers that are to be sent.  I would recommend using an array of U8.  Do the first value of 254 and the second 33.  Then use the Byte Array node in the chain.  For your data back, use the array of strings of bytes.  The first element of the returned array should be an 85.

Maybe you are looking for

  • Satellite C670D-11z - no internet

    Hello After I lost the password, I had to reinstall win7.The product key is written behind the computer so its ok. Now, the problem is that the internet does not work.When I plug cable simply does not recognize it at all. I don't have too many networ

  • Can not see all the networks Wi - Fi on Satellite P755-S5263

    Hello Just unwrap my gift: Satellite P755-S5263 and he can't see any wi - fi, I'm in the city and see a lot of networks on my BB and I press the touch button below the LCD for WE / OFF radio, nothing help, just orange light on the light wi - fi. No p

  • How to recover files deleted from windows Vista Sp2?

    I lost a bunch of files system - a few apps. do not work correctly under Vista.   I is not a disk recovery and would like to preserve as much as possible with the existing settings.   I have Sp1 and Sp2 and installation disks.  However when I try to

  • Intel X 25 - M Solid - State Drive (SSD) does not start on T60

    Hi all- I finally made the plunge and acquired a X 25 - m Solid State drive (SSD) of Intel. I spent a large part of the trial yesterday so he could boot on my T60 with no luck. My first attempt was to clone the current drive in the X 25 - M, but I go

  • GTX 750 ti 2 GB in xps 8700

    I wanted to make sure it works... This,http://www.newegg.com/Product/Product.aspx?Item=N82E16814487028 In a stock 8700 with a Blu Ray player addition and a 500 GB hard drive