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

Tags: Database

Similar Questions

  • the date conversion

    Hello Experts;

    I tried to use the to_date, but it seems to give an error message saying the following below.

    ORA-01858: a non-digit character was found here where was waiting for a digital

    01858 00000 - "a non-digit character found here where was waiting for a digital".

    * Cause: Input data to convert using a date format model has been

    incorrect answer.  The input data did not contain a number where is a number

    required by the format model.

    * Action: Fix the input data or the date format model to ensure that the

    elements correspond to the number and the type.  And then try the operation again.

    How do one converts the following

    01-SEP-95

    JANUARY 30, 96

    APRIL 7, 98

    MARCH 27, 90

    3 MARCH 01

    OCTOBER 1, 87

    15 AUGUST 02

    to DD/MM/YYYY in oracle. Thank you

    Hello

    user13328581 wrote:

    Hello Experts;

    I tried to use the to_date, but it seems to give an error message saying the following below.

    ORA-01858: a non-digit character was found here where was waiting for a digital

    01858 00000 - "a non-digit character found here where was waiting for a digital".

    * Cause: Input data to convert using a date format model has been

    incorrect answer.  The input data did not contain a number where is a number

    required by the format model.

    * Action: Fix the input data or the date format model to ensure that the

    elements correspond to the number and the type.  And then try the operation again.

    How do one converts the following

    01-SEP-95

    JANUARY 30, 96

    APRIL 7, 98

    MARCH 27, 90

    3 MARCH 01

    OCTOBER 1, 87

    15 AUGUST 02

    to DD/MM/YYYY in oracle. Thank you

    All DATEs have the same format, which is nothing like "MM/DD/YYYY".  You do not convert to a given format, convert you to DATEs, like this:

    To_date (str, 'DD-MON-RR')

    If you must explicitly show a DATE d "MM/DD/YYYY" format, then you can use:

    To_char (d, "DD/MM/YYYY"

    See https://edstevensdba.wordpress.com/2011/04/07/nls_date_format/

    I hope that answers your question.

    If this isn't the case, please post a small example of data (CREATE TABLE and only relevant columns, INSERT statements) for all of the tables involved and also publish outcomes from these data.

    Explain, using specific examples, how you get these results from these data.

    Always say what version of Oracle you are using (for example, 11.2.0.2.0).

    See the FAQ forum: Re: 2. How can I ask a question on the forums?

  • ADF 11 g: create with the data control problem: Please help

    Hello

    In my application, I tried to create a customized data controller.

    I created a Java class results and a bean ResultsBean class.
    Then I selected class results-> right click-> data controller to create.
    The Results.xml is created
    Everything is going well so far.

    Then I updated the details of class Bean in Results.xml and tried to re-create the data controller but did ResultsBean.xml ' t formed.


    In other words ResultsBean have not associated with outcome data controller.
    Please help on this.

    Version of the ADF: Studio Edition Version 11.1.1.3.0
    Build JDEVADF_11.1.1.3.PS2_GENERIC_100408.2356.5660

    Thanks and greetings
    Maryline Roussel

    Yes you use generics to the JDeveloper type, how the JDeveloper Assistant know the ResultBean is used to return an ArrayList value?

  • 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.

  • 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 chain.

    Hello

    I used following code to convert string to date but apply the time zone of the device during the conversion. I don't need this but I
    Here same time of this string.
    as
    String = '07:59:17.427 2009-07-31'
    Date = 2009-07-31 07:59:17.427

    Date formatter = new Date (HttpDateParser.parse ("07:59:17.427" 2009-07-31));
    SimpleDateFormat dateFormat = new SimpleDateFormat ("yyyy-MM-DD hh: mm:." "") "'SSS');
    String strCustomDateTime = dateFormat.format (formatter);

    SimpleDateFormat format according to the local time zone. DateFormat does not work. see the documentation for the API

  • 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.

  • Waveform display and the data flow problem

    Hello

    I have a mission and I am facing difficulties in a number of things.

    I wonder to monitor the level of CO and NH3 and the level of measured in ppm following the equations:

    for CO: 50 * (1-exp(-t/7000)) and NH3 is 35 * (1-exp(t/12000))

    The first problem, I do face is the trace of the on a waveform table.

    How can I draw on the graph of the level of CO and NH3 simultaneously / bundle tried but it don't did me not a graph.

    The second problem is that when the condition of the structure of the capital letter is true the loop stops running; How can I solve this problem?

    Thank you


  • Varchar2 to the number conversion problem

    I have some difficulty conversion strings to numbers. On my Oracle 9.2 server, it gives me an error ORA-1722:
    SELECT TO_NUMBER ('1.2') OF DOUBLE
    Apparently, this is because my server is configured to use the Greek number format (comma instead of decimal point) and substitute "1.2' above with '1.2' will work correctly."
    Is it possible for me to convert strings with decimal number type, independent of the culture so that my application will not have to depends on the locale setting of the server?

    Thank you.

    Hello

    Welcome to the forum!

    If you don't want to change the NLS settings for your session, you can specify what settings to use for a particular call to TO_NUMBER (and other features), like this:

    ALTER SESSION     SET NLS_TERRITORY = GREECE;
    
    SELECT     TO_NUMBER ('1.2')     AS wont_work
    FROM     dual;
    
    SELECT     TO_NUMBER ( '1.2'
                , '999999999.999999'
                , 'NLS_NUMERIC_CHARACTERS = '',.'''
                )          AS n
    FROM     dual;
    

    The output below shows the TO_NUMBER 1-argument fails, but the 3-argument TO_NUMBER works:

    Session altered.
    
    SELECT  TO_NUMBER ('1.2')       AS wont_work
                       *
    ERROR at line 1:
    ORA-01722: invalid number
    
             N
    ----------
           1,2
    

    The actual format of the string (the first argument) should not match precisely the format mask (the second argument). You can include signs, or omit the decimal points, so '3', ' '-1,2. '-3', ' + 1.2 ' and ' + 3' will be all converted correctly.»»» "

  • Problem with the date when you load the XML file into Oracle Database 10g

    Hi all

    I have the interface as shown in the screenshot below. In this document, among other things, I am mapping to an element XML file representing a date to an Oracle table column defined as DATE. The source and target columns are highlighted in the screenshot.

    ! http://img223.imageshack.us/img223/1565/odiscr275.jpg!

    When I run the interface, I get the following error message:

    java.lang.IllegalArgumentException to java.sql.Date.valueOf(Date.java:103)

    I guess that this is the conversion of the date!

    I already tried to replace SRC_TRADES. DEAL_DATE with TO_DATE (SRC_TRADES. DEAL_DATE, ' DD/MM/YYYY') on the implementation tab. This feature was not recognized when I executed the interface, so it did not work! The value of date in the XML file is in the format DD/MM/YYYY .

    I guess that Date SQL Oracle functions do not work in the implementation tab. Could someone let me know:

    1. what the Date Conversion function I could use instead?
    2. where can I find a reference to the methods/functions that I use in the implementation tab (if such a reference exists)?

    See you soon.

    James

    Hello.

    Try changing the area of execution at the staging area. Once you change it, write in the map box just SRC_TRADERS. DEAL_DATE. When you use TO_DATE, the source field typu should be varchar2, no date (as it is in store for your data source)

  • Check for the empty table row before adding the date

    On the form below, when I click on the green button (extreme right) plus a new row in the table is created with today's date. the user can then enter more text to the right of the date. Problem is when the form is saved and reopened, the text that the user entered is removed and today new is added because it is in the intialize event. How do I script to check and make sure that each dated line is empty before you add today's date?

    https://Acrobat.com/#d=qTINfyoXA-U6cDxOGgcSEw

    Thank you

    ~ Gift

    Hi Don,

    One possibility would be to use the box caption of the textfield for the date and leave the value part free for the user to enter their data:

    if (xfa.resolveNode("this.caption.value.#text").value === "") {
              this.caption.value.text = util.printd("[mm/dd/yy] ", new Date() );
    }
    

    See here: https://acrobat.com/#d=VjJ-YsXLKmV6QU84JrAAIw.

    Hope that helps,

    Niall

  • problem with implicit to the conversion of the date in oracle

    Next date functions will work fine as long as string confirms for the next model of the date

    D MY separator2 R separator1

    the separator can be any sign of punctuation (/ $ % & *, ^) sapces, tabs...

    as
    Select ADD_MONTHS('21$MAY*2010',2) from DUAL;

    SELECT MONTHS_BETWEEN (23 ^ FEB & 2010', ' 11% jan(2011') FROM DUAL;)

    the two works perfectly, but it does not work in the ROUND functions (date) and TRUNC (date);

    SELECT ROUND('12-FEB-2010') FROM DUAL; -gives error

    It needs explicit conversion using TO_DATE();

    My question is why what is happening?
    Is it because we have two functions ROUND (NUMBER) and ROUND (DATE)?

    Hello

    Welcome to the forum!

    user650693 wrote:
    Next date functions will work fine as long as string confirms for the next model of the date

    All of the built-in functions will work fine as long as use you them as directed; in particular, pass arguments that have the correct data type. If a function requires a DATE for an argument, always place a DATE, not a VARCHAR2 you hope will be be implicitly converted to DATE.

    D MY separator2 R separator1

    the separator can be any sign of punctuation (/ $ % & *, ^) sapces, tabs...

    This applies to explicitly call the functions where a format string is used, for example, TO_DATE.

    as
    Select ADD_MONTHS('21$MAY*2010',2) from DUAL;

    SELECT MONTHS_BETWEEN ('23 ^ FEB & 2010', ' 11% jan(2011') FROM DUAL;)

    the two works perfectly,

    As the respondent previous said, the two work may , depends on several factors, such as your NLS parameters. It's a very bad habit to rely on such things. The 1st argument to ADD_MONTHS and two arguments to MONTHS_BETWEEN, are supposed to be DATEs, so always call these functions with the DATEs.

    but this does not work in the ROUND functions (date) and TRUNC (date);
    SELECT ROUND('12-FEB-2010') FROM DUAL; -gives error

    It needs explicit conversion using TO_DATE();

    My question is why what is happening?
    Is it because we have two functions ROUND (NUMBER) and ROUND (DATE)?

    No, it's because there is no ROUND function (VARCHAR2).
    The use of strings which are expected of the DATEs is simply asking for trouble. Sometimes, you get what you're asking.

  • Download data - problems with the conversion of the date

    Hello

    I have a picture that I downloaded from a database of oracle using SAS. It has a column with dates in the following format: 10/31/2012 11:00

    When I download the data (via workshop SQL-> utilities-> data workshop-> load data) by categorizing my dates as varchar2, everything works fine... but fails when I choose my type in the Date column.

    Please advice how to fix this

    Thank you

    K I import my data with other tools. Looking at the workshop of data utility, no doubt you would put MM/DD/YYYY HH: mi: SS AM in the 'Format' field for this column.

  • Reliability of the data in the conversion to & 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.

  • Terrible problem with the dates and time UTC

    I have a countdown, but he seems to not work in other time zones. I think that the problem is related to my conversion to time UTC. If the end date is in UTC, so I have to convert the date now time UTC, too, but I couldn't find a way to do it. Here is my code - count is off because the end date is in UTC, but today's date is in local time. I could really use some quick help (before my end date can't!).

    Well, I have a solution, and it was much easier that it seemed to be.

    All the asp file has to say is:
    <%response.write FormatDateTime(now(),0)%>

    Then the as3 code is:

Maybe you are looking for

  • Apps to open and plant immediately on 9.3.3

    just downloaded 9.3.3 and freezing of phones, apps are slow to open, Instagram opens and goes down and at one point it was impossible to restart the phone (necessary to maintain the power and the home for 2 min before button it turned off). Anyone el

  • Portege R600 - fits compatible discs DVD player double layer?

    Care of the Australian for the * R600 PPR61A * state that contains the unti: * DVD SuperMulti Double Layer (7mm) *.However, the R600 does not recognize blank DVD discs dual layer using either Windows tools burn as well as Toshiba Disc Creator. Is thi

  • DeskJet 3720: Error on installing HP DeskJet 3720 on Windows 10-536870329

    Hello I just purchased this printer, downloaded the driver software and shot to the top of the installation to receive this message: I googled this problem and I saw a previous post to check the 'setupapi.dev' and 'setupapi.app' connects. Only I have

  • What disk capacity HARD Satellite A20 S-103 supports?

    Hello everyone and sorry for the bad English ;)I want to improve my laptop HARD drive but I don't know what cell maximum supported size?It's a Satellite A20 s-103, with Intel Pentium 4 2.8 GHz processor.Can you help me with this? I think buy a 160 GB

  • How does the ThinkPad T430s battery charge level

    I recently bought a Lenovo ThinkPad T430s 2356-LRG and I was wondering how to work the charge technology. I have searched and looked in the manual, but I couldn't find a good answer. My question is that I use Notepad a lot on current alternative. And