Compare a varchar2 segment column with a date column

Dear All ,
i have a segment column with datatype varchar2 with data sample like '2013/06/09 00:00:00' , i want to compare this column with date column
i tried many ways of conversion but not working like
select to_date(TO_NCHAR(substr('2013/06/09 00:00:00',1,11),'DD-MM-YY'))DATE_C from dual ---> giving invalid number
select TO_TIMESTAMP(TO_NCHAR(substr('2013/06/09 00:00:00',1,11),'DD-MM-YY'))DATE_C from dual ---> giving invalid number
can i have any suggestion for that please
thanks & best regards

Hi,
Have you tried:
SELECT TO_DATE(SUBSTR('2013/06/09 00:00:00',1,10),'YYYY/MM/DD') DATE_C FROM dual
Octavio

Similar Messages

  • Column with header data value

    Hi All.
    I have a control file which i need to add a column with header data value.
    example
    data file:
    123456;201303
    santiago;producto1;100
    santiago;producto2;200
    valparais;producto1;400
    valparais;producto3;900
    The control file skip the first column and load the three columns on the table, but, now i need to add other column with 201303 value constant of the first record and load it on the table.
    Then
    select * from table:
    santiago producto1 100 201303
    santiago producto2 200 201303
    valparais producto1 400 201303
    valparais producto3 900 201303
    How i do this in the control file?
    Regards!

    SCOTT@orcl_11gR2> host type test.dat
    123456;201303
    santiago;producto1;100
    santiago;producto2;200
    valparais;producto1;400
    valparais;producto3;900
    SCOTT@orcl_11gR2> host type test1.ctl
    options (load=1)
    load data
    infile test.dat
    replace
    into table onecol_onerow
    fields terminated by ';'
    trailing nullcols
    (filler1 filler, newcol)
    SCOTT@orcl_11gR2> host type test2.ctl
    options (skip=1)
    load data
    infile test.dat
    append
    into table test_tab
    fields terminated by ';'
    trailing nullcols
    (col1, col2, col3,
    newcol expression "(select newcol from onecol_onerow)")
    SCOTT@orcl_11gR2> create table onecol_onerow
      2    (newcol number)
      3  /
    Table created.
    SCOTT@orcl_11gR2> create table test_tab
      2    (col1   varchar2(15),
      3     col2   varchar2(15),
      4     col3   number,
      5     newcol number)
      6  /
    Table created.
    SCOTT@orcl_11gR2> host sqlldr scott/tiger control=test1.ctl log=test1.log
    SQL*Loader: Release 11.2.0.1.0 - Production on Mon May 6 10:46:44 2013
    Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.
    Commit point reached - logical record count 1
    SCOTT@orcl_11gR2> select * from onecol_onerow
      2  /
        NEWCOL
        201303
    1 row selected.
    SCOTT@orcl_11gR2> host sqlldr scott/tiger control=test2.ctl log=test2.log
    SQL*Loader: Release 11.2.0.1.0 - Production on Mon May 6 10:46:45 2013
    Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.
    Commit point reached - logical record count 4
    SCOTT@orcl_11gR2> select * from test_tab
      2  /
    COL1            COL2                  COL3     NEWCOL
    santiago        producto1              100     201303
    santiago        producto2              200     201303
    valparais       producto1              400     201303
    valparais       producto3              900     201303
    4 rows selected.

  • How to insert data in a column with uniqueidefier data type

    Guys,
    I need insert data in a column with uniqueidefier data type, when i am trying to that getting error.
    error message says: "Conversion failed when converting from a character string to uniqueidentifier."
    I have data in table a col1,col2,col3,col4 - col3,col4 has datatype as varchar and i am updating table b columns col1,col2 with table a col3 and col4.
    Please guide how to do it.

    Hi,
    Not any String can be convert to uniqueidentifier.
    1. you have to make sure u use a value which is fir to be uniqueidentifier
    2. Use convert or cast in the insert query in order to convert the string into uniqueidentifier
    insert X ... convert(uniqueidentifier, 'string which fit to be convert to uniqueidentifier')
    Please post DDL+DML for more specific help
    DDL = Data Definition Language. In our case that is, CREATE TABLE statements for your tables and other definitions that are needed to understand your tables structure and there for let us to test and reproduce the problem in our server. Without DDL no one
    can execute any query.
    How to get DDL: Right click on the table in Object Explorer and select script table as CREATE. Post these create table scripts here.
    DML = data manipulation language is a family of queries used for manipulating the data it self like: inserting, deleting and updating data. In our case we need some sample data in order to check the query and get result, so we need some indert query for
    sample data.
    If you post a "create query" for the tables and "insert query" with some sample, then we could help you without Assuming/Guessing. There is a reason that DDL is generally asked for and expected when discussing query problems - it helps
    to identify issues, clarify terminology and prevent incorrect assumptions.  Sample data also provides a common point of reference for the discussion. A script that can be used to illustrate or reproduce the issue you have, will encourage others to help.
    [Personal Site] [Blog] [Facebook]

  • Not able to save date column with custom date format. in OBIEE 11g

    Hi,
    I have migrated one report from OBIEE 10g to 11g. There is a date column with customized date format(i.e. Default format is 'dd-MMM-yyyy' and I have used 'MMM-yyyy').
    But when I use this custom format and try to save the report in 11g its giving this below error.
    ''Catalog object privilege validation failed for user to path /shared/ALM BI/Finacial Results/History Income Statement Detail.
    You do not currently have sufficient privileges to save a report or dashboard page that contains HTML markup.
    This HTML might be present in column headings, table headings, text views, narrative views, the print header,
    or the print footer and must be removed before saving.''
    Please let me know what changes I need to do for this.
    Regards,
    Ambika Nanda.

    Hi ,
    privilage issues...check the security settings once..
    Thanks,
    Ananth

  • Facing problem with a date column in select query

    Hi,
    I am facing problem with a date column. Below is my query and its fainling with " invalid number format model" .
    Query: SELECT *
    FROM EMP
    WHERE trunc(LAST_UPDATED) >= to_date(to_char(22-05-2009,'dd-mm-yyyy'),'dd-mm-yyyy')
    LAST_UPDATED column is "DATE" data type.
    Please help me Thanks

    Radhakrishna Sarma wrote:
    SeánMacGC wrote:
    WHERE LAST_UPDATED >= to_date('22-05-2009','dd-mm-yyyy');
    You do not need the TRUNC here in any case.
    I don't think so. What if the user wants only data for 22nd May and the table has records with date later than 22nd also? In that case your query willl not work. In order for the Index to work, I think the query can be written like this I think Sean is right though. Use of TRUNC Function is quiet useless based on the condition given here, since the to_date Function used by OP will always point to midnight of the specified date, in this case 22-05-2009 00:00:00.
    Regards,
    Jo
    Edit: I think Sean proved his point... ;)

  • Algning new folder with other data columns in a document library

    Hi All,
    I have created an InfoPath form that used to create a new form & a new document library and the description to that folder.
    Now my InfoPath form has some text boxes to store data. Also there is an attachment control to upload documents. These documents should be uploaded to the newly created folder.
    The new folder should display at the document library as in the same row with other data columns that were inserted to the data library. I have the problem with the new folder aligning in the same row with other data.
    So if someone can know how to solve this matter please enlighten me.
    Thank You,
    Chiranthaka.

    Can you provide more detail on what exactly you need to achieve and how your system is functioning at the moment? It sounds like you have an Infopath form that can have documents attached to it, you then store these documents into a new folder and wish to
    have the folder represented in the list view for the form in the form library you are using?

  • I am having trouble getting a numbers spreadsheet to hold different formats in the same column.  A column with a date formatted heading will not convert to $ for the cells below.   Any suggestions would help.

    I am having trouble getting a numbers spreadsheet to hold different formats in the same column.  A column with a date formatted heading will not convert to $ for the cells below.   Any suggestions would help.

    Hi Wayne,
    Thank you for this response.  I have tried this but when I start enterring $ amounts some, such as $6.00, go in OK others such as $4.00 appear as a date ie 4 Oct 12.  
    Kind regards
    Paul

  • Show all Columns with datatype = date

    Is it possible to select all columns with datatype = date in the Repository.
    We like to cast it like dd.mm.yyyy.
    Regards,
    Stefan

    Wouldn't it be easier to do it in the presentation services rather than the .rpd?
    Update: anyways, if you wanna be nasty, use something like this:
    CONCAT( CAST ( DAYOFMONTH("Siebel Data Warehouse"."Catalog"."dbo"."Dim_Incident (W_INCIDENT_D)"."CLOSED_DATE") AS VARCHAR ( 2 )), CONCAT('.', CONCAT( CAST ( EXTRACT( MONTH FROM "Siebel Data Warehouse"."Catalog"."dbo"."Dim_Incident (W_INCIDENT_D)"."CLOSED_DATE") AS VARCHAR ( 2 )), CONCAT('.', CAST ( EXTRACT( YEAR FROM "Siebel Data Warehouse"."Catalog"."dbo"."Dim_Incident (W_INCIDENT_D)"."CLOSED_DATE") AS VARCHAR ( 4 ))))))
    Message was edited by:
    ChrisBerg

  • ALV Grid Report spool problem with column with no data

    Hello All,
    I have created a simple alv grid report the report has a description field of 40 ch for which I have made the display length as 20 ch . This works fine in the foreground but when I run the report in background when there is no data in this column this being overwritten with the next column. Which is causing a mismatch between the header and the data below it.
    Also when I try to download the report in foreground into excel the columns are not matching with the headers this again happens for columns when there is no data.
    Kindly please suggest what is going wrong.
    Thanks,
    ranjan

    Hi,
    For checking the output from background job, check the job and enter JDBG in the command bar and execute.
    Check the field catalog and the table contents in debugging just before display.
    Edited by: Jayanthi Jayaraman on Dec 2, 2010 4:09 AM

  • Query To update a date column with a date of my interest

    All,
    How to update a column in a table which is in date format with a date of my interest??
    Pls suggest.

    Please detail :
    1. what exactly you are trying to do
    2. what exactly you have done
    Nicolas.

  • How to add custom columns with BO data from GP to UWL

    Hi
    We have CE 7.1 in our project UWL taskitems only have GP workflow tasks.
    In UWL we can see that by default there are standard columns but now we need to add custom columns with data from ours BO associated to process instance
    For that we need to develop one custom connector for UWL where we can retrieve the values from custom conenctor to UWL.
    Currently our NWDS 7.1 does not have plugins for UWL Connector can anybody tell me where can I download this plugins?
    thanks in advance!
    Regards
    Cristian

    Hi,
    plz refer the following link
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/f0ee5047-c7a0-2a10-70b7-9557e3e4d440
    Regards
    Manohar

  • Calculated Column with Null date end result needs to be text.

    Good Morning,
    I am using SharePoint 2010 and am trying to create a calculated column converting a date/time column to to show just a month and day.  Calculation is
    =TEXT([Anniversary],"m/d")
    This is to enable sorting on the month.  And this works fine except when there is no date entered in the "Anniversary" column.
    I have tried to modify the formula in this column to no avail.  http://social.technet.microsoft.com/Forums/sharepoint/en-US/0c9d5ae1-132a-4e02-8a91-c54708919d9a/show-calculated-date-column-as-null-when-there-is-no-date?forum=sharepointgenerallegacy
    I do not have access to modifying the code so have to work strictly OOB.  Any help would be greatly appreciated.

    I would think you could add an IF statement to verify if the text is null. So...
    =IF(ISNULL(TEXT(Anniversary, "m/d")), What we do when null, TEXT(Anniversary,"m/d"))
    Andy Wessendorf SharePoint Developer II | Rackspace [email protected]

  • Put together a TIMESTAMP column and a DATE column?

    Anyone,
    How can I piece together two columns one with a DATE and one with a TIMESTAMP and get the date with the timestamp.
    Ex.
    col_A = '4/1/1999 12:00:00.000 AM'
    col_B = '1/1/1900 9:24:47.000 AM'
    Desired Result
    new_val = '4/1/1999 9:24:47.000 AM'
    Thanks in advance,
    Miller

    Here is a pruned down version of code:
    CREATE OR REPLACE PROCEDURE MAXIMO.load_multiple_eq IS
       CURSOR c1 IS
            SELECT      LOCATION,
              ACTSTART,
              COMPLETIONDATE,
                    COMPLETIONTIME,
                    SCHEDSTARTDATE,
                    SCHEDSTARTTIME                                        
            FROM MAXIMO.NIEHS_FEB_WOEQLIST ;
         rec c1%ROWTYPE;
    BEGIN
       OPEN c1;
       LOOP
          FETCH c1 INTO rec;
          EXIT WHEN c1%NOTFOUND;
                    Insert into MAXIMO.WORKORDER (  WORKORDER.LOCATION           ,
                                                    WORKORDER.ACTSTART           ,
                                                    WORKORDER.ACTFINISH          ,
                                                    WORKORDER.SCHEDSTART         ,
                                                    WORKORDER.SCHEDFINISH           )
                    Values (   
                                rec.LOCATION,     /* LOCATION */
                                SYSDATE,          /* ACTSTART */
                                TO_TIMESTAMP(TO_CHAR(rec.COMPLETIONDATE,'MM/DD/YYYY')||' '||TO_CHAR(rec.COMPLETIONTIME,'HH.MI.SS AM'),'MM/DD/YYYY HH.MI.SSXFF AM') ,               /* ACTFINISH */
                                TO_TIMESTAMP(TO_CHAR(rec.SCHEDSTARTDATE,'MM/DD/YYYY')||' '||TO_CHAR(rec.SCHEDSTARTTIME,'HH.MI.SS AM'),'MM/DD/YYYY HH.MI.SSXFF AM') ,               /* SCHEDSTART */
                                rec.SCHEDFINISHDATE /* SCHEDFINISH */  );
       END LOOP;
       CLOSE c1;
    END;Thanks,
    Miller

  • Merge text formatted columns to single date column

    Hi folks,
    Not the most experienced of spreadsheet users, so hoping this is a quick fix:
    I need to combine text data from columns A (Year), B (Month) & C (Date) into a new column as a date. I've tried a few combinations of =DATE(C2,B2,A2), but can't pinpoint the proper merge term.
    I'd also like to know how to repeat the function down through several thousand rows without having to repeat the exercise for each row...
    Many thanks,
    Matt

    Do you know that Apple designed two well done resources PDFs which every user may download from the Help Menu ?
    There are :
    Numbers User Guide
    iWork Formulas and Functions User Guide.
    In the second one we may see:
    Your problem is that you used the reverse parameters ordering.
    Yvan KOENIG (VALLAURIS, France) mercredi 14 avril 2010 18:32:27

  • Get the month from a date column with the calculated column

    I am trying to get the month from a date field with the help of calculated column. However I get this syntax error whenever I want to submit the formula:
    Error 
    The formula contains a syntax error or is not supported. 
    the default language of our site is German and [datum, von] is a date field.

    Hi,
    I have created two columns
    Current MM-YY
    Calculated (calculation based on other columns)
    Today
    Date and Time
    Current MM-YY is calculated value with formula as
    =TEXT(Today,"mmmm")
    But the output shows as December instead of May.
    I have tried =TEXT([Datum, von];"mmmm") but no help.
    I am trying to populated the column automatically with current month..ex: if its May the field should show May, next month it should show June an so on.
    Any kind help is grateful.
    Regards,
    Pradeep

Maybe you are looking for