date to character conversion problem

Hi, if I use the query

Select to_char(hiredate,'dd-month-yyyy') in emp;

As a result like:

TO_CHAR (HIREDATE,
-----------------
-17 December 1980
-20 February 1981
-22 February 1981
02 April-1981
September 28, 1981
01-May-1981


BUT what of the query (I added one more would be "for the date format): select to_char(hiredate,'ddd-month-yyyy') from emp;

which displays the result (SEE DATES)

-352 December 1980
-051 February 1981
-053 February 1981
-092 April 1981
271 September 1981
-121 May 1981


and if I use one more would be "in like date format: select to_char(hiredate,'dddd-month-yyyy') from emp"

It displays

-3524 December 1980
-0516 February 1981
-0531 February 1981
-0925 April 1981
2712 September 1981
-1216 May 1981


Can anyone TELL WHAT MODEL OR RULE IS APPLIED HERE TO THE DATE which IS HANDLED according to THE NUMBER of a is in THE DATE FORMAT? HOW DATES ARE BEING CALCULATED WITH DIFFERENT NUMBER OF ds?

Hello

For JJ, is show you the day of the month
i.e. for December-17-1980 is 17

For DDD, it shows you the day of the year
That is to say. 17 December-1980 it is 352

For Davis, it is show you the year and day in the week.
IE.17 - December-1980 grave Wednesday (4th day of the week) is 352 and 4 i.e. 3524

Concerning
Anurag Tibrewal.

Tags: Database

Similar Questions

  • hexadecimal character conversion problem

    I'm having a problem with converting a hexadecimal character, using a custom string.

    for example:

    trace ('\x41'); I'm 'A' which works very well.

    but for example:

    trace ('\x' + '41'); I give 'x 41' which did not
    [\x' + '41']. toString(); I give 'x 41' which did not

    the backslash seems to disappear if the hexadecimal code of the string is not complete in a first time, but I need to be customized by using the two random characters on the end ((\xhh) \xhh) as instead of \xhh, make customized as follows:

    \x + hh but it won't work like that

    does anyone know a solution to this, or any possible use of a methid that seems to have no knowledge of who will do what I want to do?
    I have apreciate the help.

    Faylon456,

    > trace ('\x' + '41'); I give 'x 41' which did not
    > [\x' + '41']. toString(); I give 'x 41' which did not

    I'm with you. I don't know, honestly, why your (slash x) \x is partially
    work, because the prefix for hexadecimal numbers must be 0 (zero) x
    Maybe the forum software changed your post a little? Maybe it's my news
    drive. In all cases, you can use the parseInt() function to convert a
    string to a number - which is the first parameter - and the second
    setting determines the radix, or base, of the number to be tested.

    trace (string.fromCharCode(0)) (parseInt ("41", 16)));

    In the light of the foregoing, your 14 is passed as a string, the 16 indicates the result
    to be in hexadecimal. That allows you to bypass any escape.

    David Stiller
    Co-author, Foundation Flash CS3 for designers
    http://tinyurl.com/2k29mj
    "Luck is the residue of good design."

  • date conversion problem

    Hello

    My version of db: Oracle 11 g

    "Is there a way I can convert date in this format 04.10.15.000000000 13-SEP-06 PM' to 13-OCT-06 16:10:15 ' or 13-SEP-06 16:10:15.

    Please suggest.

    937454 wrote:

    But I need to load it into the target as "yyyy-mm-dd hh24:mi:ss" table (as you say with year-round)

    Danger Will Robinson, Danger!

    If your target table is, as it should, a date data type, then you don't have to load it into a specified format. If the source table and the target table are the two dates, so no conversion is necessary at all.

  • With Sequelink character conversion

    We are running Coldfusion 4.5 (WinNT) using the driver from Datadirect Sequelink for queries on an instance of DB2 OS/390 on MVS. There is no problem doing this, however, I test a copy of the CF 7.02, running the same applications. The DB2 driver that comes with the addition of the CF company apparently does not support DB2 in this environment, so I use the ODBC Socket to create a data source. All my queries fail with an error of truncation right due to the faulty character conversion. The queries work with the old instance of Coldfusion and other applications on the server, so I think it must have something to do with the Sequelink JDBC layer. I looked through the documents to see if there is a setting or a combination of tag that could allow the connection. Has anyone seen this?
    Also, associates, some of the CF Datasources (Sequelink ODBC Socket) now give an error to check that the data source can be found, even if the DSN is properly registered and functioning within Windows. After trying different connection strings, this has happened to various data sources. The Windows DSN now not to create a CF data source even if I have to drop and recreate it. I would switch to MX for the extra features, but I can't if it's going to kill my whole site.

    Brian

    I did a little investigate and narrowed the problem so I would close this debate and to repost my question under a different title. Thank you.

  • 11g connects to SQL server... character display problems

    Hi gurus,

    DB: 11.2
    OS: redhat 5.5

    There is a problem during display of character with sqlplus and even worse on TOAD, SQL Developer tool.

    There is a heterogeneous connection between 11g and ms sql serever. I use freedts, unixodbc and dg4odbc to connect.
    using tool isql... the select statement has been well formatted... See example |
    | USIM sales |
    | Charge accrued on debt Resprise
    BUT when I use sqlplus some characters are broken... Please see sample
    COST_NAME
    V e n s e t U S I M
    R e s p r e s i d e c h a r g e p r o v I s I o e n s e n s u r v e r
    a, c e n
    in other client tool for example, TOAD, the output is worse just see the only the first character of each line for example
    V
    R
    I tried the value for nls_language in french and English but do not solve the problem.

    anyone with a clue of what is wrong or a bug?... 1 million .thanks

    PL do not post duplicate topics - character display problems... 11g connects to SQL server

  • CRIO-9066 FIFO data conversion problem

    I'm having a problem with a multiple element SGL FIFO on a cRIO-9066 where data is not read correctly.  Here is the configuration:

    I have two Host - to - Target FIFOs, identical except for type: FXP is the other SGL.  Both are 16-element.  Data SGL which are read turns a conversion error.  A sample minimum (2014 for the 9066) project is included.

    The example works fine if the FIFO SGL 1-element; something more big fails.  Is not supported on the same 9066 thought that the project allows the creation?

    Thank you

    David

    It seems that maybe it's a bug in the Simulator.  Exit the simulation mode, run it on your target and watch the interactive mode in this way.  The results are what you expect.  It is strange that they would be converted at some point.

  • problem about dynamic data to the conversion of table 1 d

    Hi all

    I have problem with the conversion between dynamic data and table 1 d.

    I wrote a simple VI to show the problem, as the attached picture. Convert dynamic data in table 1 d, and then return to the dynamics of data, I use 3 tables of waveform display data in 3 different places, but only 'force contact 2' the graph looks normal and the 2 other cards are strange data shows. In addition, the probe indicates that data are all just before going to the charts. What is wrong with him?

    Can someone help me?

    When you convert a table, you lose your calendar information.  You need to convert a waveform and manipulate waveform data.  Use a Structure of elements in Place with waveform components to manipulate waveform data.

  • Disqualification: Date conversion problem

    Hi all

    For some reason, it turns out that which was built as 00:30:15 (HH) will be automatically converted to 12:30:15 (HH) as string value. See screenshot below.

    Date issue.png

    Tried several things in the reference list of date format, but no resolution yet. How can we avoid this conversion?

    Problem has been resolved:

    Under two date formats have been contradictory:

    DD/MM/YYYY HH: mm 23/01/2014 12:30
    DD/MM/YYYY HH: mm 03/01/2014-10:10

    Deleted the premiera and dates are converted correctly now.

  • the date conversion problem

    Hi friends,

    I have a problem with the conversion of the date in my PB.

    SELECT eff_dt, TO_CHAR (TO_DATE (eff_dt, 'Dd-mon-yy'), 'dd-mm-yyyy') DATE from une_table;

    It gives me o/p as -.

    DATE OF EFF_DT

    01.01.1950 00:00:00 01/01/2050

    as you can see here the year is wrong, while I convert the date that I use the substr() also to cut the year of first line, but it gives me the 50 i.e. onle last (YY)

    So, if someone can help me with this prob.

    If eff_dt is a column DATE, then stop calling to_date on it.

    If this is not the case, consider making it into a DATE column. If you are unable to do this, use the format mask appropriate when you call to_date

  • Problem of date Format DATE in NVARCHAR2 conversion

    Hello friends,

    Here's the issue I'm facing with conversion of dates...

    -in brands source format is DD-MM-AA and the data type is DATE
    Select brands of ABC where vehiclecode in)
    "ZCBE53585,"
    "ZCBE53561,"
    "ZCBL53668,"
    "HGMX43520")

    output:

    21/05/12
    21/05/12
    24/05/12
    22/10/44


    in the target type brands is NVARCHAR2 and trying to convert it to the format YYYY-MM-DD [to save abc.builddate in xyz.builddate]

    Select TO_CHAR (TO_DATE(abc.builddate,'DD-MM-RR'), 'YYYY-MM-DD') in xyz where vehiclecode in)
    "ZCBE53585,"
    "ZCBE53561,"
    "ZCBL53668,"
    "HGMX43520")

    output:

    2012-05-21
    2012-05-21
    2012-05-24
    2044 10-22



    If you see the last release date 10/22/44 or 1944-10-22, which I want, but the output as 2044-10-22.

    It became the big question...

    Please let me know how I can go about this...

    Thank you/kumar

    Published by: kumar73 on December 12, 2012 08:20

    Published by: kumar73 on December 12, 2012 08:21

    I swear that no other messages after the post I have repleid to were there when I posted before :-)

    kumar73 wrote:
    CREATE TABLE 'ABC '.
    (
    DATE OF 'MARKS')

    CREATE TABLE 'XYZ '.
    (
    NVARCHAR2 (20)) 'BUILD_DATE.

    I tried...

    Select brands, abc TO_CHAR(builddate,'YYYY-MM-DD') where vehiclecode in)
    "ZCBE53585,"
    "ZCBE53561,"
    "ZCBL53668,"
    "HGMX43520")

    05-21-12-2012-05-21
    05-21-12-2012-05-21
    24/05/12 2012-05-24
    22/10/44: 2044-10-22

    I want the last record in the output: 1944-10-22

    Thank you

    Published by: kumar73 on December 12, 2012 08:39

    Next, you need to set the dates broken on the ABC Board before converting. As Al said, always use 4 digit years.

    Depending on what you consider a "correct" date, you can identify the irregular with something like:

    select *
    from abc
    where builddate >  or
         builddate < 
    

    John

  • Conversion problem of oracle.jbo.domain.Date in java.util.Calendar and oracle.jbo.domain.Timestamp to oracle.jbo.domain.Date

    Hello world

    Work with dates has been harder than I thought! Please take a look at the code; everything compiles, but it fails because I'm not cast properly. Any help would be appreciated.

    Imports are:

    import java.sql.SQLException;

    to import java.text.ParseException;

    import impossible;

    import java.util.Calendar;

    Import oracle.jbo.domain.Date;

    Import oracle.jbo.domain.Timestamp;

    Here is the method:

    public static Date (String sDate, int day, nextDay

    SimpleDateFormat String) {}

    Date result = null;

    java.util.Date date;

    If (sDate! = null) {}

    try {}

    System.out.println ("Try...");

    Calendar calendar = Calendar.GetInstance ();

    SimpleDateFormat dateFormat =

    new SimpleDateFormat (simpleDateFormat);

    calendar.setTime (dateFormat.parse (sDate));

    Calendar.Set (Calendar.DAY_OF_WEEK, date); day = Calendar.SUNDAY

    Calendar.Set (Calendar.HOUR_OF_DAY, 0);

    Calendar.Set (Calendar.MINUTE, 0);

    Calendar.Set (Calendar.SECOND, 0);

    Calendar.Add (Calendar.DATE, 7);

    dateFormat.format (calendar.getTime ());

    try {}

    System.out.println ("try (inside)... ») ;

    "System.out.println (" new Timestamp (calendar.getTime () .getTime ()) "):" +.

    new Timestamp (calendar.getTime () .getTime ()));

    result = new Date (Timestamp (calendar.getTime () .getTime ())) new; Code does not work here.

    return the result;

    } catch (SQLException e) {}

    System.out.println ("catch (SQLException e)... ») ;

    e.printStackTrace ();

    }

    Returns a null value.

    } catch (ParseException exception) e {}

    System.out.println ("catch exception e ParseException... ») ;

    e.printStackTrace ();

    }

    Returns a null value.

    }

    Returns a null value.

    }

    Here is the result:

    try...

    Try (inside)...

    new Timestamp (calendar.getTime () .getTime ())): 2013-12-29 00:00:00.0

    catch (SQLException e)...

    java.sql.SQLException: failed initialization

    to oracle.sql.DATE. < init > (DATE.java:237)

    to oracle.jbo.domain.Date. < init > (Date.java:378)

    James

    try to convert timestamp to jbo.date as

    java.sql.Timestamp datetime =newjava.sql.Timestamp(System.currentTimeMillis());

    oracle.jbo.domain.Date daTime =new  oracle.jbo.domain.Date(datetime);

  • Problem with date to char conversion

    Hi all!
    I wonder why it does not work:

    SELECT TO_DATE ('& & date1', 'DD-MON-RR'), TO_CHAR ('& date1 ',' DD - my ')
    FROM DUAL;
    KEPT date1;

    Also I don't understand why I get "ORA-01722: invalid number." As far as I know what is happening when converting TO_NUMBER, which is not the case.

    The only way I got that works is:
    SELECT TO_DATE ('& & date1', 'DD-MON-RR'), TO_CHAR (TO_DATE ('& date1 ',' DD-MON-RR'), "JJ - LUN")
    FROM DUAL;
    KEPT date1;

    But this way, it is heavier.

    The expression TO_CHAR ('& date1 ',' DD - my ') turns into something like this:

    TO_CHAR('01-Jan-09', 'DD-Mon')
    

    This generates the error you mentioned:

    SQL> select TO_CHAR('01-Jan-09', 'DD-Mon')
      2  from dual;
    select TO_CHAR('01-Jan-09', 'DD-Mon')
                   *
    ERROR at line 1:
    ORA-01722: invalid number
    SQL>
    

    Why? Just because TO_CHAR expected a numeric value to the first position. If you give him that, and then you will immediately hit the following error:

    SQL> /
    select TO_CHAR(42, 'DD-Mon')
                       *
    ERROR at line 1:
    ORA-01481: invalid number format model
    

    The second position of TO_CHAR should hold some model valid number format, the date format template provided, does not represent.

  • Data capture, etc. using SQL Developer mysql Orac conversion problems

    Hello

    I have been using Sql Developer to try to convert my mysql database to oracle, I managed to set up the connections and the repository very well. However, when I right click on my database connection and click on the capture of the capture window appears but nothing happens. What I am doing wrong?

    Thank you


    Aaron

    This error usually indicates a corrupt repository of migration or a user privilege is missing.

    Also the migration of SQL Developer 2 and 1 repository is not compatible - so I would say to create a single repository user for each new version.
    It is a repository of sample for SQL Developer 2.x user:

    CREATE USER migration IDENTIFIED BY migration DEFAULT TABLESPACE users TEMPORARY TABLESPACE temp;

    GRANT CONNECT, RESOURCE, CREATE VIEW, CREATE A PUBLIC SYNONYM TO
    Migration WITH the ADMIN OPTION.

    GRANT ALTER ANY ROLE, ALTER ANY SEQUENCE, ALTER ANY TABLE, ALTER TABLESPACE, ALTER ANY TRIGGER, COMMENT ANY TABLE, CREATE ANY SEQUENCE, CREATE ANY TABLE, CREATE ANY TRIGGER, CREATE ROLE, CREATE TABLESPACE, CREATE USER, DROP ANY SEQUENCE, DROP ANY TABLE, DROP ANY TRIGGER, DROP TABLESPACE, DROP USER, DROP ANY ROLE, GRANT ANY ROLE, INSERT ANY TABLE, SELECT ANY TABLE UPDATE no matter WHAT TABLE OF migration;

  • Reliability of the data in the conversion to &amp; from a Variant...

    It is possible to convert any data type to a variant, and then turn it back on.  In doing so, are there data types who will lose information during the conversion process?  If so, why?

    Yes, you can convert any type to a variable ranging and back. There is a VI called "Variant data" which will have a type as input. He continued to convert the variant the correct data. The side variant must know what type of data to expect. He can pull of the Variant. However, you can use a cluster of generic data that consists of a username and a Variant. Then you can have different types of data which can handle the side reception. It is a two-step process. One of conversion the variant of general type (data type and Variant cluster). The second would be a case statement uses the type then covert the internal variant to the specified type. This approach is used for generic messaging systems. The upper levels of the code will know what to do with the data. The lower levels are just generic data passing around.

    I'm not aware of any information that get lost during the conversion of the data to and from a variant. Of course, I not had no problem using them.

  • String to number conversion problem

    I have a VI that pulls in data from a device using VISA, and I got it on another computer to work a few weeks back. I had to transfer the VI to a laptop computer to run a few tests, and now I can't make it work. I am unable to put my VI because the laptop on it's is unable to access the network companies, I will do my best to explain it all, I apologize for the inconvenience! My problem is not however with VISA, it's with an exit VISA number conversion chain.

    I have attached a painting drawing of VI to better explain it.

    I use the block series Visa football match in baud rate and all that many good things to the unit and port settings set of device management. Then, a while loop is entered. The loop will run until you press the stop"" button. The next block of visa is the writing block, he asks for a reading of the device. The next block of visa is the first block of reading, he returns playback in the form of "NA-XXX. X' where x are numbers. The next block of visa is the second reading block, this block just echoes back the command sent to the device. Playback of the first visa read block, "NA-XXX. X' is going exponential/fractional chain to digital converter.

    When you perform a run/debug to highlight run, the release of visa reports the correct value, is the value of the device reading - however the string to number converter generates a 0,000, no matter what channel number is. I am at a loss as to what may be wrong because it's the EXACT set up I had to work very well a few weeks ago!

    I'm using Labview 10 on the laptop, the old computer was labview 7. I'm guessing that this is perhaps the rub... I Redid the VI from scratch, although I have not opened the old VI in labview 10.

    Any help would be appreciated. Again, sorry I am unable to attach the VI.

    DARB wrote:

    I have attached a painting drawing of VI to better explain it.

    Would it not have been easier to just post a screenshot? You might also have used the Tool of Capture of Code. (Which reminds me that I need to install it to my previous versions of LabVIEW, as evidenced by the screenshot I took. )

    As to the question: you probably either:

    • employee analysis of chain initially and when you rewrote the VI you used the regular string conversion functions.
    • Wired an offset value in the string to the number function.

Maybe you are looking for