Convert float to date data type

How to convert the float to type date data type... the time stamp is actually stored type float in one of the tables.can, I use the cast function?

For example... 39086.4047337963 (to convert to the format of the timestamp or date)

user8813441 wrote:
I got the answer from one of the forums

SELECT TO_DATE ('19000101', 'YYYYMMDD') + 38497.6531944444
DOUBLE;

Assuming that it isn't something different right course...

SQL> ed
Wrote file afiedt.buf

  1  SELECT TO_DATE('19040101', 'yyyymmdd') + 38497.6531944444
  2* FROM dual
SQL> /

TO_DATE('19040101',
-------------------
26/05/2009 15:40:36

SQL>

This would also be a reasonable answer, unless of course your sales/technical design has already stipulated that the float should be the number of days since January 1, 1900.

However, you don't mention that in your original post, so how could anyone experienced that?

Tags: Database

Similar Questions

  • convert the money data type in a decimal format 2.

    What is the best way to convert the money data type in a decimal 2 format in ms sql 2005 for use in my applications.

    This?

    CAST (tr.depositReceivedAmount AS decimal (10, 2))

    I respectfully disagree with the idea that you must change the query column a type of 'money' data to something else.

    In most database servers, "«argent» Silver" is a data type that is designed to provide a very homogeneous behaviour with regard to the arithmetic accuracy.  In Microsoft Access, the representation is a the whole scale.  MS SQL Server, it is obviously similar.  Ditto Oracle and others.

    You like that the money data type in the database for this clarification, because "hell has no fury like an accountant looking for a bad penny."   The column of database storage formats are designed to satisfy the accountants, and it's a good thing.

    Meanwhile, you also want to take care as to exactly how you are dealing with values.  There are several points where the district could take place.  You don't have available the strongest possible manipulation of the floating of the data types in ColdFusion.  You also are somewhat at the mercy of any interface software can be between you and that SQL server, you can use.  "It is correct to all about values , but not several times."

    I suggest to round the value just before the display and user input must be two decimals.

    Then, you may need to do some things at the end of SQL server.  For example, when you update a value in the table, you may need to use logical server to explicitly truncate the value to two decimal places, as well as an update of "$ 34,56" explicitly updates the column "$34,5600.."  (This kind of thing should happen in the context of SQL Server).  You know that the user entry has exactly two significant digits, but maybe (maybe not...)! SQL server may not know this.  You want to ensure that the stored server internally represents exactly two digits, when the origin of a user input value.

    Do not err on the side of "convenience" or "which seems." good on the screen  (If you do, get ready get telephone communications of the accountants, always at inappropriate times of the night.)

  • I want to convert the double data type to string type

    I want to convert the double data type to string, have idea about that

    Hello

    Use f

    FN: String (ARG) returns the string value of the argument. The argument can be a number, boolean, or node-set element

    Example: string (314)
    Result: "314".

    http://w3schools.com/XPath/xpath_functions.asp#string

    See you soon,.
    Vlad

  • convert the varchar2 data type to the data number type

    How to convert the varchar2 data type to the data type number.


    It looks like my data

    create table one)
    col1 varchar2 (50)
    col2 varchar2 (500);

    Insert in a (col1, col2) values ('1234 ', ' 2345');

    Select Column1 of number (19)) cast (to_number (col1);

    IAM getting error invalid number


    I need to create a table with the same columns with data like number types (19)

    can someone help me

    Thank you

    You have changed your original post, so now I see that you get the invalid number.

    This is why you should always avoid the varchar columns to store numbers or dates...

    Since your table source contains a nonnumeric value, you can write a pl/sql to convert data and see what records are false:

    SQL> insert into a (col1,col2) values ('xxxx','2345');
    
    1 row created.
    
    SQL> select * from a;
    
    COL1     COL2
    -------- --------
    1234     2345
    xxxx     2345
    
    2 rows selected.
    
    SQL> create table b (col1 number(19), col2 number(19));
    
    Table created.
    
    SQL> set serverout on
    
    SQL> declare
      2  cursor c is
      3  select * from a;
      4  begin
      5    for r in c loop
      6     begin
      7       insert into b values (to_number(r.col1), to_number(r.col2));
      8     exception
      9       when invalid_number then
     10        dbms_output.put_line('Row rejected: col1='||r.col1||' col2='||r.col2);
     11     end;
     12    end loop;
     13  end;
     14  /
    Row rejected: col1=xxxx col2=2345
    
    PL/SQL procedure successfully completed.
    
    SQL> select * from b;
    
          COL1       COL2
    ---------- ----------
          1234       2345
    
    1 row selected.
    

    Max

    Published by: Massimo Ruocchio, June 14, 2011 20:00
    Added the first query in the example

  • Convert a varchar2 data type Date

    Hi guys,.

    Can someone help me convert a Varchar2 data type in the data type Date?

    I have a query and my column is a varchar2 data type.
    I want to just that convert the Varchar2 in a DATE, because I met
    problem in my query. I want to do the day1 day10 transaction.

    Ex:
    Day 1 = January 1, 2010
    Day10 = January 10, 2010

    table.record_date varchar2 (12)

    SELECT column1, Column2
    table
    where record_date between? and?

    How can I set the record_date between day1 and day10 since record_date is of type varchar?

    Thank you.

    Laetitia

    Lala,

    If the data in the database are in the format MM-DD-RR , then you must use the same format when you convert back to this day.

    So change the query to

    SELECT COLUMN1, COLUMN2 FROM TABLE WHERE TO_DATE(RECORD_DATE, 'MM-DD-RR') BETWEEN TO_DATE('01-JAN-2010') AND TO_DATE('10-JAN-2010')
    

    Kind regards

    Manu.

  • How to handle the data type DECIMAL MySQL converted to DOUBLE in OBIEE 10 gR 3?

    Hi all

    I have a problem in OBIEE 10g to I use the MySQL database as datasource direct to the server of the OBI and I have a column in a MySQL table which was designed as the DECIMAL data type (18.0).
    This column is used to measure a length, and values are included in seconds (without decimals), in the form as:
    "1200"
    in the MySQL database.

    After the import of the MySQL table associated with the repository of the OBI, the OBIEE converts the DECIMAL data type column to the DOUBLE PRECISION data type automatically.

    My goal is to reach the values in this form, certainly in the sense of the term (not at the time!):
    hh mm ss

    In order to accomplish, I tried to change the format of column with the ROUND function:
    ROUND (db.table.column / * 3600 * 2)

    The problem is that it doesn't work well if values can be divided with no rest for example
    original value: 7200
    new value (ROUND): 2

    In the case of my example:
    original value: 1200
    new value (ROUND): 0
    It's false, because 1200 seconds are not equal to 0 hours, I want to see two hours of _0.33333_ OR I much prefer more _0 hour 20 m_

    Anyone have any ideas?
    I tried to make a view of database and importing that type of CHAR data in the database, but is not the solution too, because if I filter BI app or try to make a SUM the BI would drop errors...

    Kind regards
    Laszlo

    Hello
    SE refer to this link, it is exactly will meet your need.

    OBIEE 11 g - change seconds in the format hh: mm: DD
    OBIEE functions

    Share updates... :)

    check if useful/correct...

  • Subtype and data types

    Hi all

    We can overload subprogrammes that setting differ in the number, order, and type of family data. But impossible to overload if the parameter differs only in the void type.

    If I see the standard package, I get
    subtype types BINARY_FLOAT is NUMBER;
    subtype BINARY_DOUBLE is NUMBER;

    But I am able to overload the two procedures, we have a parameter types binary_float and binary_double other. They are of subtype of the same data type. that is the number. So, how is it possible. Also, most of the subtypes have no difference. So, why are there these number of subtypes? Oracle defines subtypes as data type with some sort of constraint on the base data type, but is valid for all? for example, smallint, and decimal.

    type of NUMBER is NUMBER_BASE;
    subtype of FLOAT is NUMBER;
    ACTUAL subtype is FLOAT;
    subtype 'DOUBLE PRECISION' is FLOAT;
    INTEGER subtype is NUMBER (38.0).
    subtype INT is INTEGER;
    subtype SMALLINT is NUMBER (38.0).
    DECIMAL subtype is NUMBER (38.0).
    DIGITAL subtype is DECIMAL;
    DEC subtype is DECIMAL;

    >
    We can overload subprogrammes that setting differ in the number, order, and type of family data. But impossible to overload if the parameter differs only in the void type.

    If I see the standard package, I get
    subtype types BINARY_FLOAT is NUMBER;
    subtype BINARY_DOUBLE is NUMBER;

    But I am able to overload the two procedures, we have a parameter types binary_float and binary_double other. They are of subtype of the same data type. that is the number. So, how is it possible. Also, most of the subtypes have no difference. So, why are there these number of subtypes? Oracle defines subtypes as data type with some sort of constraint on the base data type, but is valid for all? for example, smallint, and decimal.

    type of NUMBER is NUMBER_BASE;
    subtype of FLOAT is NUMBER;
    ACTUAL subtype is FLOAT;
    subtype 'DOUBLE PRECISION' is FLOAT;
    INTEGER subtype is NUMBER (38.0).
    subtype INT is INTEGER;
    subtype SMALLINT is NUMBER (38.0).
    DECIMAL subtype is NUMBER (38.0).
    DIGITAL subtype is DECIMAL;
    DEC subtype is DECIMAL;
    >
    Some of those who, as a smallint, SQL ANSI data types. See table 2-6 ANSI Datatypes converted to Oracle data types in the doc of the SQL language
    http://docs.Oracle.com/CD/B28359_01/server.111/b28286/sql_elements001.htm

    Oracle allows the name of the ANSI data type to use and combines the name of the ANSI for the appropriate Oracle data type
    >
    ANSI SQL/DS and DB2 data types

    The SQL statements that create tables and clusters allows also ANSI data types and products IBM SQL/DS and DB2 data types. Oracle recognizes the ANSI or IBM data type name that differs from the Oracle database data type name. It converts the data type for the equivalent Oracle data type, stores the Oracle data type under the name of the column data type and stores the data in the column in the data type Oracle based on the conversions listed in the following tables.
    >
    But BINARY_FLOAT and BINARY_DOUBLE types are each defined as unique data types (see table 2-1 in this doc).

    Because they are unique Oracle data types, they can be overloaded.

  • For the complex data type, how to generate the Dll with compatible interface to C/C++

    Hello

    I used the Labview FPGA module to develop test equipment. Now, I need to write a driver that is to be a Dll with compatible interface to C/C++ for this equipment. So that my client who is familiar with C/C++ can call the driver without any study on labview. But I had a few problem on how to convert labview for C/C++ data complex data type. To clearly explain to my question, I have attached a simple example. (see attachment) I try to generate a Dll for the attached example VI and get the the function prototype at the head of the files as below:

    ' void OpenFpgaReference (LStrHandle * RIODevice, TD1 * errorIn, LVRefNum * FPGAVIReferenceOut, TD1 * errorOut).

    As you have known, the type of data "LStrHandle * RIODevice" and "LVRefNum * FPGAVIReferenceOut" Labview data format are. C/C++ do not have this kind of data type and can not reconige it. As a result, I can't call the Dll of C/C++ programming language. How to convert these two data type of labview for the C/C++ compatible data format, and then build the Dll? Anyone know about this?

    The answer is really apprecaited! Thank you in advanced.

    Ivan.Chen wrote:

    As I found in the following article:

    http://digital.NI.com/public.nsf/WebSearch/FB001AA027C8998386256AAD006C142D?OpenDocument

    LVRefNum is the name of resource of LabVIEW VISA or refnum, and "it is impossible to convert LabVIEW VISA name of resource or refnum VISession valid ID."
    This means that external code modules can not access & control the session VISA which is open by labview. But for my purposes, I will not attempt to access this VISA extenal code(C/C++) session. I just hope that save this session VISA in the external code once I opened it in Labview dll; and pass it to the labview dll when needed. While I have not need to login again when I need to control the device. Is it possible to do?

    A LVRefNum is really just a single int32 value. Its meaning is useless for other environments than those who created it so that you Michael not any what in C/C++ caller but pass it back to other functions in your DLL, but this often isn't a problem at all.

    You can take the following statement of the LabVIEW extcode.h headers and add them to your delabviewed header files to make it work in such a way.

    #define Private (T) typedef struct T # _t {void * p ;} * T}

    Private (LVRefNum);

    The LStrHandle you must set a standard C string instead in your export DLL and document what is the size of the string buffer should have if it is an output parameter.

    TD1 error clusters should also be divided into their parameters (C compatible) separate for all items or just to the left of suite entirely.

    Rolf Kalbermatter

  • Conversion of the data type of a table column

    Hello

    I have a column with the varchar2 data type. I want to convert to number data type. But the data in the table are not lost. Can someone suggest me how to convert the column with the varchar2 data type to store the data in the table of number data type.

    Thanks in advance

    try something like this

    create table t(col varchar2(10));
    insert into t values('1');
    insert into t values('2');
    commit;
    select * from t;
    alter table t add  col1 number;
    update t set col1 = to_number(col);
    commit;
    alter table t drop column col;
    alter table t rename column col1 to col;
    select * from t;
    

    Published by: Karthick_Arp on April 6, 2009 12:32 AM

  • How to convert a string to a data type double

    I'm eager to take a string representation of a number and convert it to an INT64 data type to perform a function.  What can I use for this?

    Do a right click on the blockdiagram... go to programming--> string--> sting / numberconversion--> fract/expstringtonumber

  • How to convert an array of string elements to a cluster with elements named different data types?

    I'm looking for more help with the conversion of an array of elements of the chain in a cluster containing elements named different data types.

    I am importing data from an Excel worksheet.  He is coming in LabVIEW as separate (channels) 3 tables: 1) Variable name, (2) three possibilities Int, double, String) data type and the value 3), with the clues in each table corresponding to a separate variable (I have about 180 variables to import).  My ultimate goal is to convert the string array of 'Value' in a cluster.  But I want the correct data type in the cluster and I also the elements of the cluster name to match with the string 'Variable name' table so that I can use the Unbundle based on the name in my main VI.

    Please see attachment a Subvi for more details.  I did the size of the new items of tables 5 for simplicity.   I realize that labels property cannot be changed during execution and I don't think I need to do.  I just want to use the production cluster (mainly the unbundle by name) to help design my main VI.  I will need to 'read' and 'write for' the cluster during execution, but I won't need to change the names of the items.

    I was also wondering if there is a better way to import data from Excel?  Is it possible to import directly into a cluster immediately rather than put everything as strings?  I have attached a Subvi showing how I currently bring in data (found on the forum somewhere).  It comes as table 2D, which I divided into 3 separate tables that I mention above.

    I am open to any suggestion.  Thank you very much.

    -Mike

    Instead of trying to create a cluster, I think I would use only variant attributes.

  • The data type double in CT that is converted to PDM

    Hi all
    In short, to be able to remove channels and groups of a PDM file, I convert the file to a tdm, delete channel or group storage using screws and the convert to PDM. The problem is when tdms is converted to tdm, double data types (64-bit) became simple types (32-bit). Original tdms file has double inside, but CT and resulting tdms files have singles.
    Attachment VI made things I mentioned above. After execution of the it, I open tdms - 1.tdms in Excel with importing tdm (v3.3.0.0) and data type is DT_DOUBLE. But in the files tdm.tdm and PDM - 2.tdms, data types are DT_FLOAT. So the question is, is there a way to prevent duplicate converted to singles?

    Note: I convert the files tdms tdm, screw that removes channels and storage groups do not work with the PDM format.
    p.s. I'm on LV2011.

    Hello

    This is a known bug, CAR 399895. We'll fix it in the future.

    In your LabVIEW, you can try to change the next VI.

    \\vi.lib\Platform\storage\utility\_DP2TDMData.VI, in the case of "DT_DOUBLE", please select instance Float64.

    Hope this helps,

    Mavis

  • Convert a U8 array to a data type of LabView

    In my code, the entrance is a fixed-length U8 array reflecting the data in memory, I need to convert it to a predefined data type. For example, the first 2 elements U8 in the arrary must comvert a U16, then 4 U8 U32 data elements data. I wonder if there is an easy way to do this kind of conversion.

    Type casting Man and his trusty Sidekick Unflatten chain are itching for action.

    Use Unflatten chain if you have problems with "endianness".

  • VARCHAR2 data type do not convert date

    Dear gurus

    Version of database - 10.2.0

    I have a problem of varchar2 data type do not convert date...

    I have a table like


    SQL > table desc.
    Name Null? Type
    ----------------------------------------- -------- ----------------------------
    NAME VARCHAR2 (10)
    RECORD_DATE VARCHAR2 (20)

    and the record consists are...

    SQL > select * from table;

    NAME RECORD_DATE
    ---------- --------------------
    Nimai 09/09/2012 09:10
    Nimai 09/09/2012 10:10
    Scott 09/09/2012 11:10
    Scott 09/10/2012 10:00
    Nimai 09/10/2012 11:00


    If the "Record_date" column that's 09/09/2012(dd/mm/yyyy)

    09/09/2012 and I want to query the records which includes the date ' select * from table where record_date = 09/09/2012 "...
    This work of query...

    Select * from table where
    TO_CHAR (to_date (substr(record_date,1,10), ' dd/mm/yyyy'), ' dd/mm/yyyy')
    =
    TO_CHAR (to_date (substr('09/09/2012',1,10), ' dd/mm/yyyy'), ' dd/mm/yyyy')
    ;

    But if the "record_date" column that's 9/9/2012(d/m/yyyy) I did not what to do which function to use? /

    Help, please!

    Thanks in advance
    Nimai kinzonzi

    Published by: 955748 on September 22, 2012 03:47

    Published by: 955748 on September 22, 2012 04:10

    Hello;

    Keep things simple: (get rid of TO_CHAR)

    SELECT TO_DATE ((substr (record_date, 1, 10), ' DD/MM/YYYY') of?)

    TO_DATE (substr (record_date, 1, 12), "HH24 MON-DD-YY")

    Best regards

    mseberg

  • How to convert clob data type varchar2.

    Hello
    If select below questioning the data type must be varchar2 but I want to convert the text to a clob.


    Select 'World' of double;


    Kind regards
    Fame
    SQL> Select 'My_name is rajuvan' Vrchr,
    2       TO_CLOB('My_name is rajuvan') clb
    3      from dual; 
    
    VRCHR                          CLB
    ------------------------------ ------------------------------
    My_name is rajuvan             My_name is rajuvan
    
    SQL>
    

Maybe you are looking for

  • Battery drains when it is plugged

    The battery must discharge on my iPhone iOS 6sPlus 9 when you use an application if it is plugged into the socket?

  • iPhone 6 s not connet to tunes on computer

    I can't get my iphone appears on itunes. I tried several threads and restart both without success. My phone is displayed on the computer and I can download my photos, but I can't see it on itunes. I want to just be synchronized.

  • Bookmarks disappering

    My profile is stored on a mapped network drive. Recently, they have begun to disappear. When I first run firefox, they're here. After a random delay they just no longer appear. My categories remain, but a fair choice shows a list (empty) container. I

  • How can I delete google custom search bar of about: newtab page

    When I open Firefox or a new tab I updated: newtab which is great and all. Recently, I noticed a Google search bar on the new tab page, however, it immediately affect my cursor. I type in the address normal upstairs bar. If I do not do that tedious e

  • GPIB is not indicated in gpibexplorer on mac

    Hi all I'm working on an osciloscope using a gpib-ENET 100 of reading.  The GPIB just flashes orange, in network mode, and when I search using the Explorer, it does not show.  Indications on where I spoil it would be appreciated.  This will read the