How to extract the date of varchar2?

I have a varchar2 (20) of the column that stores the date value in a format "MM/DD/YYYY".

I want to compare the value with the date value for records within 30 days only.

I use following, but it failed with the error.
 select * from tab where to_date(day,'DD-MON-YY') >= trunc(sysdate) - 30 ;

ERROR at line 1:
ORA-01843: not a valid month
day value of the sample: 16/01/2013
20/03/2013

-Thank you

Hello

rcc50886 wrote:
I have a varchar2 (20) of the column that stores the date value in a format "MM/DD/YYYY".

This isn't a really good idea. The current problem is just one example of why you should use a DATE for date information column.

I want to compare the value with the date value for records within 30 days only.

I use following, but it failed with the error.

select * from tab where to_date(day,'DD-MON-YY') >= trunc(sysdate) - 30 ;

Use "DD/MM/YYYY" above, not: "DD-MON-YY '.

ERROR at line 1:
ORA-01843: not a valid month

When you use 'DD-MON-YY' as the 2nd argument of TO_DATE, you say that the day of the month will come first, and that the valid months are "JAN", "Feb",..., "DEC". '16' is not one of them.

day value of the sample: 16/01/2013
20/03/2013

-Thank you

Published by: Frank Kulash on 27 March 2013 14:25

Tags: Database

Similar Questions

  • How to extract the date of birth of the employee Table

    Hi experts,

    I'm new to SQL, help for my problem Pls

    I saw an employee table
    CREATE TABLE 'NIM_EMP '.
    (VARCHAR2 (20) "EMP_NO")
    "EMP_NAME' VARCHAR2 (100),
    VARCHAR2 (50) "EMP_DESIG."
    'HIRE_DATE' DATE,
    NUMBER OF "EMP_SAL."
    NUMBER OF "EMP_DEPT."
    DATE OF THE "DATE OF BIRTH".
    ) ;

    with data is as

    Emp_No - 203
    EMP_Name - Thérèse
    EMP_Desg - system administrator
    HIRE_Date - 10/12/2011
    EMP_SAL - 25000
    EMP_DEPT - 10
    DATE OF BIRTH - 09/02/1987

    Problem-1 - I want to show the birthday information to all users, because "it is today the anniversary of Mr.Upendran as - 25 years"

    Problem-2 - "today, Mr. Upendran is completed a year of Service in our concern" (this is based on the Date of HIRING)

    How to extract data from SQl

    Thanks in advance,
    Thérèse

    913370, you are right in both cases. I have corrected my code for the raw material.
    The second question may be fixed, because there is no sex information in the table.

  • How to extract the data in a grid format in an area of the bean in forms 6i?

    Hello

    I need help from all the gurus and the experienced people in forms 6i. I'm currently building the shape that will have certain text fields and a bean area that displays the records that I had entered. Suite to the essentials is the basic form structure, I am developing

    1. There will be a search form that will have two text fields 'Emp ID' and 'Name Emp' and two buttons 'New' and 'find '.
    2. There is an alternative, which will have an area of bean that allows to display the following columns in it in the form of a GRID
    a. Emp ID
    (b) name of the Emp of
    This form will be also two 'Emp ID' and 'Name Emp' text fields.
    3. when I press 'New' in the search engine so the second form should open and it will be empty. I can enter data into text fields and save the form. The area of the grid (the bean area) must be empty.
    4. when I reopen the search form and enter the 'Emp Id' I just created in the previous step and click on the "Search" button then the following form should open and the "Emp Id" and the text "Emp name" fields must be populated with the data that I created in step 3 and the bean area must also display the record in the form of a grid.

    I'm ok with all parties except the part of area of bean. Can you help me hpw to develop the form with the area of the bean and extract data when wanted and display as a grid?

    Take a look at the link I provided. Francis already has an example of implementation of a Java data grid on a form. The direct link is: http://forms.pjc.bean.over-blog.com/article-1830062.html

    Craig...

  • How to extract the date parameter, which must appear in the report model?

    Hi gurus and Experts.

    I need to shoot the date setting, I chose at RANDOM to appear in my report model? How this code at RANDOM?

    Identifier are: dto and cdes
    Channel marker date: MM-DD-YYYY

    Kind regards

    JP

    Published by: user10955574 on November 10, 2010 02:38

    Published by: user10955574 on November 10, 2010 02:39

    Declare the parameter in the model as

    and use it as

  • How to extract the data that ends with GG replicat process all ignore replicat parameter is ued for installing bidrectiona?

    Hi all

    I have 2 DBs in the two-way GG configuration and using ignore replicat parameter to avoid a loop. I want to know if another application also sends data via GG to one of the DBs and want to include that data extract, process that must be sent to the downstram system.

    Thank you

    Traoré

    I fixed the problem by putting in place the parameter called NOTRACETABLE.

    Thank you all for your support.

    Traoré

  • How to extract the data in the table in the database

    Hi all

    IM using PHP/MySQL and I use implode () function to store several values of checkboxes that have been selected in the form. Does store the word 'Table' in my database. How can I get back all of each data I've been record before (each of the checked instead of the word Array value)?

    If you don't have that in the database is the Word table, that's all you'll get back out. It sounds like you do not store the information correctly.

    Let's say that your form contains a series of checkboxes, all are called options. For all values, you must add square brackets after the name in the form:

    Sun roof
    Satellite navigation
    Air conditioning

    If the form is submitted using the POST method, the values will be stored in an array called $_POST ['options']. To store in the database, you must check whether the table exists and then use implode ():

    if (isset($_POST['options'])) {
      $options = implode(',', $_POST['options']);
    } else {
      $options = '';
    }
    

    Then insert $options into the database.

  • How to extract the data from each row

    Hello

    I wrote a CQL query with lines 3 records. Is it possible in this query to fetch the first record and last present specific field values.

    for example,.
    Column: c1, c2, c3
    Record1: id1, 2,3, 3.5
    Record2: id2, 2.3, 3.6
    record Record3: id21, 2.3, 3.7
    record Record3: id25, 2.3, 3.9

    I need to get the average of three rows of c3 and get the first record id and last record ID.

    Output 1: id1 id1, avg (c3) = 3.5
    output2: id1, id2, avg (c3) = 3.55
    Output3: id1, id21, avg (c3) = 3.6
    output4: id2, id25, avg (c3) = 3.733

    Please help on above.

    Thank you
    Sri

    Hello

    Not quite sure that understand what is the problem that you see.

    Here's what I got when I ran the query:

    Input data:

    C1, c2, c3
    ID1, 2,3, 3.5
    ID2, 2.3, 3.6
    id21, 2.3, 3.7
    ID25, 2.3, 3.9
    DELAYED26, 2.3, 4.0
    ID27, 2.3, 4.1

    Query:

    Select T.firstC1, T.lastC1, S1 T.avgC3
    () match_recognize
    measures
    First (M1. C1) as firstC1,
    M2. C1 as lastC1,
    AVG (C3) as avgC3
    all matches
    model (A B? C ? | D + C)
    subset m1 m2 = (A, B, C) =(A,D)
    define
    At as prev (A.c1) is null.
    B as (count (*) = 2),
    C as (count (*) = 3),
    D like ((prev (D.c1) is not null) and (count (*))<>
    ) t

    Output:

    firstc1, lastC1, avgC3
    ID1, id1, 3.5 - avg only trace
    ID1, id2, 3.55 - avg from two records
    ID1, id21, 3.6000001 - avg from three recent reviews
    Id2, id25, 3.7333336 - avg from three recent reviews
    id21, delayed26, 3.8666668 - avg from three recent reviews
    ID25, id27, 4.0 - average last three book reviews

    This output confirms with you that mentioned the expected results?
    Can you please run this query as it is on the above mentioned input data and check by yourself?
    If you don't get the desired result, please paste the input data provided, complete the text of the query and the outputs.

    Concerning

  • How to extract the party date XML dateTime data type

    Hi all

    I have a problem with the extraction of the date part of the dateTime data type. I am getting my output * 2012-09 - 28 T 21: 49:45 * in this format. I need to extract the date part which is

    * 2012-09-28 * excluding the time. Kindly help me out by doing this. I'm new to the world of xml. Sorry if this question seems to be too stupid, but I'm quite help less.

    Thank you

    What error do you get?

    These two work for me:

    let $myDateTime := xs:dateTime("2012-09-28T21:49:45")
    return {$myDateTime cast as xs:date}
    
    let $myDateTime := xs:dateTime("2012-09-28T21:49:45")
    return {xs:date($myDateTime)}
    
  • How to analyze the data of 10 bytes encoded in the HH306 of Omegatte data logger/thermometer?

    I am trying to write a simple code for a HH306 of OMEGAETTE thermometer/travailleursduweb.com data recorder.

    That is the problem. I communicate with the device via RS - 232, using Labview 8.5.1 and windows xp. I ask her for "all the coded data", which is actually the only option. He returns 10 bytes of encoded data, the manual describes the meaning of each byte and I understand that. The problem is that I can't analyze the information for use in labview, for example: I want to extract the temperature and simply display it.

    on request, I get: 10bytes (read as a string from the serial port read buffer): display HEX: 02 00 A8 48 FF EF B6 49 B6 03 is perfect, and what I expect.     Display codes: \02\00\A8\B6H\FF\EF\B6I\03 The Normal display is a series of special characters, I don't understand, especially since I don't think they are ascii characters that must match returned hexadecimal numbers!   For the life of me, I can't understand how to extract the information (what are the 48 6 hexadecimal display) of what is returned. All string manipulation functions seem to work only on what is given in Normal view. (The 4th and 5th byte of the data are the codes of the BCD for temperature: for example the temperature was 64.8 degrees farenheight when I took this reading).

    Can someone help me to analyze the data returned by this device?

    Ok... I think that I thought about it. I found this: http://digital.ni.com/public.nsf/websearch/77C8F61D36F5A23086256634005ACB38?OpenDocument.

    I guess the normal display garbled is corresponding to each hexadecimal ascii characters. I'm just not used to seeing characters beyond the decimal number 127 ascii or hex 7F.

    So, basically, to analyze the 10 bytes of data:

    (1) break the string read from the serial port in the 10 ascii characters (using String subset vi)

    (2) son of each output string in the left input of 10 separate Type vi Cast.

    (3) wire a constant U8 in each terminal 'type' VI Type Cast.

    cables of 4) the chain of each Cast of Type vi output to the input of a number hexadecimal string vi.

    (5) concatenate or use as you wish as hexadecimal numbers (now in string format) which cause.

    See you soon.

  • Need urgent help! In my Vision Application, how to extract the parameters of the geometric model specified curve was generated by the template editor OR?

    I have an application of machine vision, in which the geometric pattern match technique was used to find the target in the images of type variant.

    as we know, we do a geometric model by model OR editor in the editor we can adjust the parameters of the curve specified settings to get the desired curves and we derive the custom box to ignore during the match. then we save the use of the same model in our application of vision.

    Now my question is coming. When I program my request for the geometric game. I have specified the parameters of the curve for the entrance of the IMAQ Advanced Setup learn ringtone 2, of course, I have to adjust this identical to the model, but I don't know how we extract the geometric model. I tried all the methods, for example, I can read data custom, IMAQ get characteristics of the geometric model(it's just for the basic functionality? so is there even a VI based edge?), even at anasys PNG file formats! But I can't read the info of the geometric model by myself!

    It is also illogical to adjust the CURVE SETTINGS manually again for the " IMAQ Advanced Setup Learn Pattern 2" after that I already have in the template editor OR!

    Hello

    Why do you need to specify the curve settings once again, if you have already built a model using the template editor? You don't need to use "IMAQ Advanced Setup learn geometric model 2 VI" to find games (see the attached example).

    You can wire the 'curve settings' control to 'IMAQ configuration geometrical game model 2 VI', but the values are not used if wire you a Boolean true to the node "use learning curve settings" (it's like that by default). To prove it, I enclose a small program with pre-created model (using the template editor) for a geometrical alignment. The model and the test of three images are also included.

    Try changing the settings of the curve with the 'use know curve settings' enabled, and you will see the corresponding score remains the same. Disable the Boolean control, then try to change the curve settings.

    Also take a look at the detailed help for "IMAQ configuration geometrical game model 2 VI", specifically the "learning curve parameters of use."

    I hope this helps.

    Best regards

    K

  • Foglight v6 - FaultException: impossible to extract the data of inventory of the collector

    After having modernized our virtual center to V4, the foglight fails to report all the details and only has the following alert:
    "FaultException: impossible to extract the data of inventory of the collector: the parameter name cannot be null or an empty string."
    ' Parameter name: key to make sure the collection agent service is running.
    If anyone else has had this problem and how to solve?
    Thank you
    Karim

    Hi Joviyach,
    I logged a call with Vizioncore and the resolution is as follows:
    the problem you have is related to a VMware problem experienced during the upgrade to vSphere 4.0 as detailed in: kb.vmware.com/.../search.do
    Bascially, you must run a SQL command of your Virtual Center via MS SQL Management Studio that will identify one or more VMs who have a missing entry in the VPX_VIRTUAL_SCSICONTROLLER table. Once this information is determined that you would follow the steps 2 to 6 of the reolution... basically remove these virtual machines of the inventory and adding them back.
    When these steps are complete, you will re-start the vFoglight Collector of Vmware and Vmware vFoglight connector services.

  • How to extract the values of XMLTYPE column,

    SQL > create table temporary global xmtype_tab (xmlfile xmltype);

    SQL > select * from all_directories;

    SYS RESTOREDIR/home / / dbimptask /.

    insert into xmtype_tab values (xmltype (dbms_xslprocessor.read2clob ('RESTOREDIR ','LAS_SETUP.xml ')));

    1 line of creation.

    SQL > select * from xmtype_tab;

    XMLFILE
    --------------------------------------------------------------------------------
    <? XML version = "1.0"? >
    rowset <>
    < ROW >
    < DATA_CAPTURE_ON > 1 < / DATA_CAPTURE_ON >


    How to extract the values inside each tag?


    XML file has the following data...


    rowset <>
    < ROW >
    < DATA_CAPTURE_ON > 1 < / DATA_CAPTURE_ON >
    < > 9600 BAUD_RATE < / BAUD_RATE >
    < ACK_TIMEOUT > 1 < / ACK_TIMEOUT >
    < TUBE_TRAVEL_LIMIT > 4 < / TUBE_TRAVEL_LIMIT >
    < SEND_SID_TIMEOUT > 1 < / SEND_SID_TIMEOUT >
    < INDEX_Q_TIMEOUT > 2 < / INDEX_Q_TIMEOUT >
    < HW_HANDSHAKING > 1 < / HW_HANDSHAKING >
    < / ROW >
    < / LINES > ';

    I use the Oracle 10.2.0.3 version...

    Why does this work?

    You are missing the tag of the ROWSET:

    select extractvalue (xmlfile, '/ROWSET/ROW/BAUD_RATE') baud_rate
      from xmltype_tab
     where existsnode (xmlfile, '/ROWSET/ROW/BAUD_RATE') = 1;
    
  • Extracts the Date of Date part /Timestamp part

    Hello

    How to extract the party only date without the timestamp value in SQL. For example, from 2008-05-13 01:34:20, I need to extract only the 2008-05-13...


    Thank you...

    Hello

    Try

    Select to_char(SYSTIMESTAMP,'YYYY-MM-DD') DATE_EXT FROM DUAL;
    

    * 009 *.

    Published by: 009 March 14, 2010 23:30

  • Anyone know how to check the date of warranty until when?

    Anyone know how to check the date of warranty until when?

    https://checkcoverage.Apple.com/Jo/en/;JSESSIONID=9pJ0X9pFPJtNg3c44yDGCvk9pVpt5l QSgn4B60y4Skv1WfmnqMkF!-1840326800

  • How to find the date item was my favorites on Mozilla Firefox

    on system moot bookmark how to find the date of the bookmark?

    In bookmarks menu select organize bookmarks to open the bookmarks library. In the bookmarks library, click views, and then display the columns and then added. This will display a column showing when a bookmark has been added.

Maybe you are looking for