Date Format converting... Help, please

Hello

I have a date column in the table, which has two formats and the data type of the column is varchar2, how to convert them to a format.

Example of data as below:

1. 1 OCTOBER 12 12.00.00 AM

2.02 / 11/2015 12.00.00 AM

Help me please to convert them to the format (DD/MM/YYYY HH)

Originally, you started with

Example of data as below:

1. 1 OCTOBER 12 12.00.00 AM

2.02 / 11/2015 12.00.00 AM

In your error report, it reads

INSERT INTO TEST VALUES (11 NOVEMBER 14 09:26:25 "");

INSERT INTO TEST VALUES ('2014-01-31 23:33:25 ');

INSERT TEST VALUES (OCTOBER 14, 2014 05:44:55 ');

While initially it was possible to establish a distinction between the formatted strings differently based on the occurrence of a hyphen in each case a dash, it is no longer possible with your examples of more recent data.

In addition, your second line of input currently requires "HH24" to the address of the value of the time correctly.

With the updated data and the General advice to store dates in DATE columns, you could try the long

ALTER TABLE TEST ADD(ACTION_DATE_NEW DATE);
UPDATE TEST SET ACTION_DATE_NEW = CASE
  WHEN LENGTH(ACTION_DATE) = 18 THEN TO_DATE(ACTION_DATE, 'DD-MON-YY HH24:MI:SS')
  WHEN LENGTH(ACTION_DATE) = 19 THEN TO_DATE(ACTION_DATE, 'YYYY-MM-DD HH24:MI:SS')
  WHEN LENGTH(ACTION_DATE) = 20 THEN TO_DATE(ACTION_DATE, 'DD-MON-YYYY HH24:MI:SS')
END;
COMMIT;

and continue from there.

See you soon

Kirk

Tags: Database

Similar Questions

  • Generate report with a date picker. Help, please

    Hello

    I'm building an interactive report which should display the records corresponding to the date picker.

    I'm going to pull a report emp_name and LOAD_DT.  LOAD_DT is a date column from table1.

    Select "emp_name," LOAD_DT from table1

    where LOAD_DT =: P44_PICK_A_DATE;

    I chose article page to submit P44_PICK_A_DATE

    When I choose a date, he gives no error data

    Help, please.

    Thank you

    KJ

    Bind variable in the APEX will behave as strings. I normally apply TO_DATE(:P1_MY_DATE) without the date format and rely on application session formats / align.

    In your case, it would be more efficient to

    where load_date = to_date(:P44_PICK_A_DATE)

    unless you do something specific with date formats, then you would be just details the to_date

    Keep in mind, this also applies to the numbers, it would be more explicit

    where id = to_number(:P1_ID)

    Which is related to why there is a function v() and nv().

  • How can I add the form date picker? Help, please.

    Hello everyone am new here... drew a stack of site Web but I'm now trying to find how to add a switch of dates for my site... anyone please can help you.

    It is not yet supported by Muse. You can find a widget for this to www.musewidgets.com or use a third party such as WooForms or JotForms shape provider.

  • I can't import my rushes. How can I make my files supported formats? Help, please!

    Hi, I have a big problem and I'm on a deadline! I can't import my footage in Windows Movie Maker. How can I make my files supported formats?

    Convert to a format...

    The. WMV format is the best choice for video files.

    There are to many converters available on the net...
    the following links are some examples. You can
    need to experiment to find the best result.

    Proceed at your own risk *.

    (FWIW... it's always a good idea to create a system)
    Restore point before installing software or updates)

    (1) format Factory (freeware)
    http://www.videohelp.com/tools/Format_Factory
    (the 'direct link' is faster)
    (the file you want to download is: > FFSetup270.zip<>
    (FWIW... installation..., you can uncheck
    'all' boxes on the last screen... even in this case, it may
    install the Ask toolbar on your system)
    (Windows XP / Vista / 7)

    First, you will need to decompress the file or just open the
    Drag FFSetup270.exe out of the folder
    and drop it on your desktop. To install left click.

    (2) Freemake Free Video Converter (freeware)
    http://www.Freemake.com/free_video_converter/
    (Windows XP / Vista / 7)

    (3) Koyotesoft Free Video Converter
    http://www.koyotesoft.com/indexEn.html
    (2000/XP/2003/Vista/Seven)

    (4) Sothink Free Video Converter
    http://www.Sothinkmedia.com/video-converter/
    (Windows XP / Vista / 7)

    (5) hamster Free Video Converter
    http://www.PCWorld.com/downloads/file/FID, order 155794, 4 pages, 1/download.html
    (Windows XP, Vista, 7)
    (If you choose Custom Installation
    You can uncheck additional modules you
    do not want to install)

    (6) quick Media Converter
    http://www.Cocoonsoftware.com/
    (Win XP, Vista, Win 7 Home Premium)

    (7) SUPER © Simplified Universal Player Encoder & Renderer
    http://www.videohelp.com/tools/Super
    (the download mirror site is faster) (Windows XP / Vista / 7)

    (8) Xilisoft Video Converter
    http://www.Xilisoft.com/video-converter.html
    (not freeware but receives good reviews)
    (Windows XP (SP2 or later) / Vista / 7)

  • I can't find all the albums I have uploaded before the date limit. Help, please!

    I uploaded several photos and albums of Revel before the deadline, but cannot find them. I wasn't able to use the old adobe id and I fear that they are associated with the other account. Someone from Adobe can help me please? I am desperate... many family photos are gone!

    Your att.net account is one that has pictures - the same one that you are connected to this forum.  Is - that you're connected to?

  • I'm having issues by rotating the following data... help please...

    So the following question:

    SELECT YEARS_,METRIC_NAME,METRIC_VALUE from (
      (SELECT to_char(ADD_MONTHS(SYSDATE,((-ROWNUM+1)*12)),'YYYY') YEARS_ from DUAL CONNECT BY LEVEL<=5)
      LEFT JOIN CORE_METRICS on YEARS_=CORE_METRICS.METRIC_SUBNAME
      and CORE_METRICS.METRIC_VALUE IS NOT NULL)
    
    
    

    SPOKEMETRIC_NAMEMETRIC_VALUE
    2013BACKUP_TB_COST100
    2014BACKUP_TB_COST200
    2013VMAX_TIER1_TB_COST150
    2014VMAX_TIER1_TB_COST300

    What I would do, it's this array of PivotChart so that the METRIC_NAMES are the columns and values are the METRIC VALUE

    and each row in the returned table would be one spoke...

    So, something like

    YEARS BACKUP_TB_COST VMAX_TIER1_TB_COST
    2013100150
    2014200300

    I want to display. I don't know because I'm on 11g can I somehow turn the table around, or do I have to write a PLSQL procedure to cope with this.

    Thank you

    Rob

    Hello

    bostonmacosx wrote:

    with pivot_data as (SELECT spoke, METRIC_NAME, METRIC_VALUE of)

    (SELECT to_char (ADD_MONTHS (SYSDATE, ((-ROWNUM+1) * 12)), 'YYYY') spoke of DOUBLE CONNECT BY LEVEL)<>

    LEFT JOIN CORE_METRICS on spoke = CORE_METRICS. METRIC_SUBNAME

    and CORE_METRICS. METRIC_VALUE IS NOT NULL))

    SELECT spoke, METRIC_NAME, pivot_data METRIC_VALUE

    pivot)

    SUM (METRIC_VALUE)

    for METRIC_NAME

    IN (NETAPP_TB_COST,

    MAINFRAME_COST_PER_CPU,

    VMAX_TIER1_TB_COST,

    VNX5500_TB_COST,

    RS6000_COST_PER_CPU,

    SERVER_COST_PER_CPU,

    BACKUP_TB_COST,

    VMAX_TIER2_TB_COST)

    );

    In the PIVOT clause, use single quotes around names:

    pivot)

    SUM (METRIC_VALUE)

    for METRIC_NAME

    IN ('NETAPP_TB_COST',

    "MAINFRAME_COST_PER_CPU,"

    "VMAX_TIER1_TB_COST,"

    ...

    "NETAPP_TB_COST" (inside the single quotation marks) is a constant string 14

    NETAPP_TB_COST (outside the quotes) indicates a column or a function with the same name of 14 characters.  You get an error message on any such column existing if you do not have another error, to use a column name where a constant is expected, first of all.

    Of course, I can't test anything, until you post the data.

  • Data merge problem - HELP Please!

    To say that I'm new to data fusion would be a VAST understatement...

    I'm trying to merge the names of the companies of CSV in InDesign, but the apostrophes in names come through as to the strange time characters when I spotted and merge the document.  Does anyone have a solution? I am desperate at this point.

    Thank you!

    Work may be on a Mac with a CSV file generated by a user of Excel on Windows?

    By connecting your CSV, look for the 'Show Import Options' button. There you can select your delimiter (usually a comma, right?) and your platform and Encoding. If my above assumption is correct, then you will want to set it to ASCII and PC , but if it's another arrangement, you must find the right platform and encoding by trial and error, or understand the source encoding and the platform of the CSV in other ways.

  • I need help with installing XP after re format! Help, please!

    I would like to reformat my computer, a dell I bought 6 years ago. I have the re XP install disc and key code, but the disc is totally destroyed! How can I re install my xp with service plack 1 without the cd?

    You will need to borrow a comparable CD of a person, or perhaps you contact Dell and hope they are in a benevolent mood.

    Good luck.

  • No even H.264 in Quicktime format! Help, please.

    I need H.264, but I don't know howw to get it! I'm on Windows 10 which is not download Quicktime so the H.264 option isn't there. Any suggestions?

    Use Adobe Media Encoder to make H264 files, either as native files or in Quicktime containers.

    In choosing the Composition/add to the queue of Media Encoder, you can render directly from After Effects.

  • Convert char to date format in obiee 11g?

    Hello

    I want to convert char to date format in obiee 11g.

    I have this date

    ' 07/31 /' | CAST (YEAR (CURRENT_DATE) AS CHAR)

    I want to change the tank to the date format.

    Please help me,

    Thanks in advance,

    A.Kavya.

    Below him is based on my date format NLS source Oracle database as DD-MON-RR (query on the database - SELECT * > OF nls_database_parameters WHERE the PARAMETER = "NLS_DATE_FORMAT").

    Note that this is not altered by the connection of the RPD pool, which is common.

    If the date that I put together for substrings and Casts a match before it can be LAUNCHED as a DATE. IE 31 July 15 etc.

    Steps to follow:

    -Drag a field to the report, one

    -Change the formula

    -Paste in

    CAST ("31 - Jul -" |) SUBSTRING (CAST ('F_PL_BAL'. ' BUSINESS_DATE ' AS CHAR) FROM 8 TO 2) AS DATE).

    -OK

    -See the results

  • date format help

    Hi all

    I have a table with a column report_date (varchar2 (20));

    the data is stored in this way in this column
    Ex:
    20111017
    20111016
    20111024
    20110918

    Format: YYYYMMDD

    How can I find the dates between October 15, 2011 and October 17, 2011 when the data is stored in this format?

    Help, please. Thanks in advance

    Hello

    MR Marie wrote:
    Hi all

    I have a table with a column report_date (varchar2 (20));

    the data is stored in this way in this column
    Ex:
    20111017
    20111016
    20111024
    20110918

    Format: YYYYMMDD

    How can I find the dates between October 15, 2011 and October 17, 2011 when the data is stored in this format?

    Help, please. Thanks in advance

    Since you have strings, and DATEs not real, the more effective and less prone to passing error is:

    WHERE   report_date BETWEEN '20111015'
                        AND     '20111017'
    

    Stroing date in a VARCHAR2 column information are not a good idea. It is better to use TIMESTAMP (or DATE) instead.

  • Assign the value of a char date to a date format column

    Hello

    I have a table with columns target say

    col1 varchar2;
    col2 date;

    I have to insert the form data source whose columns are

    col1 varchar2;
    col2 char (8);

    How can I assign the date of tank to the target column.

    Date in the source format is '20110412'.
    I need the same formula in the target.

    I used to_date (source.col1) to assign.
    I get data such as April 12, 11.
    I don't want this format.

    Help, please.

    Published by: user13616389 on April 12, 2011 04:31

    Hello

    This is because the setting NLS_DATE_FORMAT. You need to change it according to your need.

    ALTER session SET NLS_DATE_FORMAT = "YYYYMMDD" statement

    SQL > select to_date('20110412','YYYYMMDD') from double;

    TO_DATE (')
    ---------
    12 APRIL 11

    SQL > alter session SET NLS_DATE_FORMAT = 'YYYYMMDD ';

    Modified session.

    SQL > select to_date('20110412','YYYYMMDD') from double;

    TO_DATE)
    --------
    20110412

    Thank you
    Fati

  • Lightroom do not read and download photos from my camera - help please?

    I have Lightroom and have used successfully for about 9 months with my Nikon D800

    I recently bought a Nikon D500 as a return to the top of body.

    When you try to download my first photos on the D500, Lightroom would not read them. I searched and found an update of the software. After update, Lightroom read and downloaded pictures of the D500.

    Now, Lightroom will not read or download new photos taken on the original D800!

    I have searched for new updates to the Lightroom software but tells me that my sorter is up-to-date.

    Help please!

    Hi andrewd,.

    What version of Lightroom do you use?

    Display the exact error message you get when importing.

    D500 requires Lightroom 6.5/CC 2015.5. Cameras supported by Adobe Camera Raw

    Kind regards

    Assani

  • convert date format period

    Hi all

    Here are my existing query which I run another tool to extract data from oracle-

    Select * from transactionTbl

    WHERE

    DATE > = TO_DATE (' $(vAppStartDate)', "DD/MM/YYYY")

    AND DATE < = TO_DATE (' $(vAppEndDate)', "DD/MM/YYYY")

    variables-

    -vAppStartDate = 06/01/2014

    -vAppEndDate = 30/06/2015

    Rather than use the Date column in the WHERE condition, I want to use PeriodID of column existing in the same table, to make the query faster.

    The period column is in below format.

    PeriodID format-> 201294 //means 2012Q 4. So 9 means Q

    Since I'm on variables, the values are always to the date format, so my requirement is first change variable date from periods of format.

    I wrote the pseudo-code, because I of course know how to convert date format periodID. Q also means in the periodID 9.

    Select * from transactionTbl

    WHERE

    PeriodID > = period_function (TO_DATE (July 1, 14 ',' DD/MM/YYYY '), 'YYYYxx')

    AND PeriodID > = period_function (TO_DATE (July 1, 15 ',' DD/MM/YYYY '), 'YYYYxx')

    Please help me with the query.

    Thank you!

    Calling a user-defined function is likely to slow down your query.

    What's the problem with just using regular date formatting strings for example

    SQL > select to_char (to_date('15/09/2014','DD/MM/YYYY'), 'YYYY "9" Q') of double;
    TO_CHA
    ------
    201493

    1 selected line.

  • Although I have paid my subscription to Acrobat export to PDF (order AD19503326) I'm unable to convert a PDF to Word. When I try to do, the system asking me to pay again for the service. Help please.

    Even if I subscribe to Adobe export in PDF, annual, I can't convert any PDF into Word or Excel.  Whenever I try to convert a file system refuses to convert & request

    make me pay for a subscription again.  My order # AD019503326, the order date 14 February 2016.  Help please.

    Denis Davignon

    E-mail "dkdavignon [email protected]".

    Hi denisd27715882 ,

    Please see "cloud.acrobat.com", after the signing in using your Adobe ID select the export option in PDF format from the top menu. Then follow the on-screen instructions to export the files.

    You can also use Acrobat Reader DC for export files, please visit this link:- https://helpx.adobe.com/acrobat/using/exporting-pdfs-file-formats.html

    If the same problem persists, please go to "Adobe.com/getsupport", select the option for 'still need help contact us' and then start the chat session.

    The chat expert will help you after having looked into the account using the tools.

    Kind regards

    Christian

Maybe you are looking for

  • Can 'push you' audio?

    I seem to have constant problems to dialogue to match the lips. Available in iMovie movement is simply not enough end and seems to 'click ' sound in a way devoid of sense rather than any amount that you want it to move. Any tips? Honestly, iMovie is

  • Contact does not receive messages

    Hello, I need emergency aid, like one of my Skype contacts does not receive any of my messages, but I can receive all their I tried to register another account, but it still does not work, I have no idea why

  • Pavilion Intel Core i3 8 GB of RAM: How can I get my HP Office Jet Pro 8600 printer to work using Windows 10?

    With the help of a Microsoft Windows 10 w / a HP Office Jet Pro 8600. How can I get the printer to operate windows 10?

  • Windows 7 SP1

    I have a HP Pavilion p6730f desktop computer.  My browser upgraded to Internet Explorer 11, but only needs can be done until I installed Windows 7 SP1.  Where can I download SP1?

  • Best SSD for a T420 under $ 200

    Hello I'm awkward between a T420 and a 220 X, especially because the X 220 has a smaller screen and I don't know how I'll be able to adapt to that (I already have glasses, so...). What is the best SSD for the T420 under $ 200? Almost any larger than