Change Format date

Hi
There is a table with column datatype is varchar2(11) with data like
21-DEC-2010
22-DEC-2010
23-DEC-2010
28-DEC-2010
29-DEC-2010
29-DEC-2010
28-DEC-2010
29-DEC-2010
01-DEC-2010
28-DEC-2010
29-DEC-2010How can I put data in format 'DD/MM/YYYY' I tried with
   select   TO_date(t.nota_data,'DD-MON-YYYY')
from tb_carga_fat_suma tBut show me error message:
ORA-01843: not a valid month

SQL> with t as (
  2  select ('21-DEC-2010') str from dual union
  3  select ('22-DEC-2010') from dual union
  4  select ('23-DEC-2010') from dual union
  5  select ('28-DEC-2010') from dual union
  6  select ('29-DEC-2010') from dual union
  7  select ('29-DEC-2010') from dual union
  8  select ('28-DEC-2010') from dual union
  9  select ('29-DEC-2010') from dual union
10  select ('01-DEC-2010') from dual union
11  select ('28-DEC-2010') from dual union
12  select ('29-DEC-2010') from dual
13  )
14  --
15  --
16  --
17  select str
18  ,      to_char(to_date(str, 'dd-MON-yyyy'), 'dd/mm/yyyy') new_str
19  from   t
20  /
STR         NEW_STR
01-DEC-2010 01/12/2010
21-DEC-2010 21/12/2010
22-DEC-2010 22/12/2010
23-DEC-2010 23/12/2010
28-DEC-2010 28/12/2010
29-DEC-2010 29/12/2010
6 rows selected.

Similar Messages

  • Who change format date?

    hi,
    who i can change format date in servidor ORACLE for all client?
    Thank´s

    The default format can be set by changing the NLS_DATE_FORMAT initialization parameter and restarting the database, alter system set nls_date_format = "YYYYMMDD" scope=spfile; and the database has to be shutdown and restarted to enforce the change. It might be alter database instead of alter system, I usually try the wrong one first.
    But the setting can be overridden in the client setup or changed in a user session, there's no way to enforce a particular format on the client environment.

  • Change format date TO_DATE(TRUNC(DBMS_RANDOM.VALUE...

    Hi all...
    I am trying dbms_random like this :
    **Type data :
    AAAA VARCHAR2(35)
    BBBB VARCHAR2(6)
    DDDD VARCHAR2(20)
    E_DATE VARCHAR2(14)
    **store procedur :
    BEGIN
    FOR X IN 0..3 LOOP
    INSERT INTO TEST VALUES (
    'AAAA--'|| dbms_random.string('X', 28),
    'BBBB' || TO_CHAR (TRUNC(dbms_random.value(0,10))),
    'CCCC--'|| dbms_random.string('X', 12),
    TO_DATE(TRUNC(DBMS_RANDOM.VALUE(2455532,2455563+3)),'J')
    END LOOP;
    END;
    Output :
    AAAA BBBB DDDD E_DATE
    AAAA--RTL2OWN8RVOMY1IUD93RP91RWOQA BBBB1 CCCC--JCWAXRO3TMP0 12-DEC-10
    AAAA--629F3A4AIW5E4OHCDVFZ41SFB2U4 BBBB5 CCCC--DLAUZO511Y97 12-DEC-10
    AAAA--XHKR95JISQRTRH54KNOQKDVUJ6QF BBBB6 CCCC--K7CHOT2KULNV 10-DEC-10
    AAAA--7DRZ38SPRIN26HNA7VPQV9FKWCCQ BBBB7 CCCC--FXV3CCY3BWHY 09-DEC-10i want format E_DATE to DD-MM-YYYY without change type data and still use dbms_random...
    Could you pls solve me out ?
    Thank you
    -newbie-pl/sql-

    Hi,
    Sorry, I'm not sure I uderstand the problem.
    Are you getting the date correctly, but you want to store it in a VARCHAR2 column? That's not a very good idea: dates belong in DATE columns, but if you ever want to convert a DATE into a string, use TO_CHAR:
    TO_CHAR ( TO_DATE ( TRUNC ( DBMS_RANDOM.VALUE (2455532, 2455563+3)
                , 'J'
         , 'DD-MM-YYYY'
         )or equivalently:
    TO_CHAR ( DATE '2010-12-01' + dbms_random.value (0, 34)
         , 'DD-MM-YYYY'
         )Since you're not displaying the hours, minutes or seconds, there's no point in using TRUNC just to set them to 00:00:00.
    Edited by: Frank Kulash on Feb 9, 2011 10:32 PM

  • Change format date for Calendar Prompt!!!

    Hello there,
    For a date prompt when I choose *"Calendar"* in my control, the default format shown by the calendar is d/mm/yyyy.
    I want to save the value of my date prompt into a Presentation variable with the format yyyy-mm-dd. What conversion function can be used to achieve this?. In oracle the easiest way is TO_CHAR(dateHere,'YYYY-MM-DD') but when I apply this in the Edit Formula of the prompt it gives me an error.
    I know the date format for a Calendar object can be changed in the configuration file, but I want to avoid this, because I might affect other users.
    Please help.
    Thanks
    Edited by: PabloC2 on Feb 18, 2009 1:36 PM

    yes, I restarted presentation server and oc4j.
    but has no effects.
    date prompt has strange behaviour...
    for Administrator user
    in English locale
    default format YYYY-MM-DD
    after change date by calendar, it has M.D.YYYY format
    in my locale
    default format YYYY-MM-DD
    after change date by calendar, it has YYYY.M.D format
    for other users
    in English locale
    default format YYYY-MM-DD
    after change date by calendar, it has YYYY.M.D format
    in my locale
    default format YYYY-MM-DD
    after change date by calendar, it has YYYY.M.D format

  • Change formatting dates with GREP

    I am laying out a book with thusands of dates all formatted e.g 02-03-1913. I want to hange these to (eg) 2nd March 1913. I expected it to be a lengthy, staged, operation. But I cannot get GREP to recognise specific numbers (e.g. 02) If worked through logically I did think I could do it in stages. Can anyone help?

    Hi,
    Using Multi-Find/Change, 12 regex, 1 set. So, 1 click and done!
    1/ Search:  (0?)(\d+)-01-(\d{4})
    Replace by: $2~Sjanuary~S$3
    2/ Search:  (0?)(\d+)-02-(\d{4})
    Replace by: $2~Sfebruary~S$3
    12/ Search:  (0?)(\d+)-12-(\d{4})
    Replace by: $2~Sdecember~S$3

  • How to change the date format?

    Hi,
    I need to display the data format as(YYYY-MM-DD). But now it displays(2009-1-9)
    Here is my code snippet which i used to display the data format as(2009-1-9)
    *<INPUT TYPE=TEXT NAME="date_submitted" MAXLENGTH=20 SIZE=10 VALUE="" onBlur= "return dateSubmitted()">  (YYYY-MM-DD)*
    *<SCRIPT LANGUAGE="javascript">*
    dateSubmitted()
    *</SCRIPT>*
    function dateSubmitted()
                        if (document.pgUpdate.date_submitted.value == "")
                             date = new Date();     
                             month = date.getMonth() + 1     
                             document.pgUpdate.date_submitted.value =
                                            date.getYear() + "-" + month + "-" + date.getDate();
                        return true;
    Can anybody help me how to change the date format?
    Thanks in advance!

    prit123 wrote:
    use SimpleDateFormat class. The code is :He posted a Javascript related question, not a Java related question.
    Please use forums devoted to Javascript. You're here at a Java/JSP forum.
    There are JS forums at webdeveloper.com and dynamicdrive.com. Good luck.
    String formatPattern = "yyyy-mm-dd";
    SimpleDateFormat sdf = new SimpleDateFormat(formatPattern);
    sdf.format(yourdate);yyyy-mm-dd denotes year-minutes-days. Please go read the SimpleDateFormat API as well.

  • Changing the Date format in iCal

    Is there any way to change the date format from American (MM/DD/YY) to European (DD/MM/YY) in iCal?
    Thanks in advance.

    As far as I'm aware, it should respect what you specify in the Formats tab of the International pane in System Preferences.

  • How can I change the date format in Reminders and in Notes?

    How can I change the date format in both Notes and Reminders? Preference on Imac and Settings in IOS do not allow me to change the format in those 2 apps.
    I Like to see 10oct rather than 10/10, as an example.

    pierre
    I do not have Mavericks or iOS - but the first thing I would do is reset the defaults - I'll use Mavericks as an example
    From If the wrong date or time is displayed in some apps on your Mac - Apple Support
    OS X Yosemite and Mavericks
        Open System Preferences.
        From the View menu, choose Language & Region.
        Click the Advanced button.
        Click the Dates tab.
        Click the Restore Defaults button.
        Click the Times tab.
        Click the Restore Defaults button.
        Click OK.
        Quit the app where you were seeing incorrect dates or times displayed.
        Open the app again, and verify that the dates and times are now displayed correctly.
    Then customize to taste - OS X Mavericks: Customize formats to display dates, times, and more
    OS X Mavericks: Customize formats to display dates, times, and more
    Change the language and formats used to display dates, times, numbers, and currencies in Finder windows, Mail, and other apps. For example, if the region for your Mac is set to United States, but the format language is set to French, then dates in Finder windows and email messages appear in French.
        Choose Apple menu > System Preferences, then click Language & Region.
        Choose a geographic region from the Region pop-up menu, to use the region’s date, time, number, and currency formats.
        To customize the formats or change the language used to display them, click Advanced, then set options.
        In the General pane, you can choose the language to use for showing dates, times, and numbers, and set formats for numbers, currency, and measurements.
        In the Dates and Times panes, you can type in the Short, Medium, Long, and Full fields, and rearrange or delete elements. You can also drag new elements, such as Quarter or Milliseconds, into the fields.
        When you’re done customizing formats, click OK.
        The region name in Language & Region preferences now includes “Custom” to indicate you customized formats.
    To undo all of your changes for a region, choose the region again from the Region pop-up menu. To undo your changes only to advanced options, click Advanced, click the pane where you want to undo your changes, then click Restore Defaults.
    To change how time is shown in the menu bar, select the “Time format” checkbox in Language & Region preferences, or select the option in Date & Time preferences.
    Here's the result AppleScript i use to grab the " 'Short Date' ' + ' 'Short Time' "  to paste into download filenames - works good until I try to post it here - the colon " : " is a no-no but is fine in the Finder
    Looks like iOS Settings are a bit less robust
    - Date/Time formats are displayed according to 'tradition' of your region > http://help.apple.com/ipad/8/#/iPad245ed123
    buenos tardes
    ÇÇÇ

  • How to change the date time format in jsp

    Hello Sir,
    I am trying to convert the date from one format into another format.
    In SQLServer one fields type as datetime.
    when i tried to display it in jsp with String variable it shown like below,
    2006-08-16 09:11:23.0
    how to format this value as
    Wed, Aug 16, 2006 09:11 AM
    my code is
    java.text.SimpleDateFormat fmt= new java.text.SimpleDateFormat("EEE, MMM d, yyyy K:mm a ");
    fmt.format(string value fetch from dtabase field);
    Plz provide me the solution asap. very urgent request.
    Regards
    venki.

    Hello Sir,
    I am trying to convert the date from one format into
    another format.
    In SQLServer one fields type as datetime.
    when i tried to display it in jsp with String
    variable it shown like below,
    2006-08-16 09:11:23.0
    how to format this value as
    Wed, Aug 16, 2006 09:11 AM
    my code is
    java.text.SimpleDateFormat fmt= new
    java.text.SimpleDateFormat("EEE, MMM d, yyyy K:mm a
    fmt.format(string value fetch from dtabase field);
    Plz provide me the solution asap. very urgent
    request.
    Regards
    venki.Have a look in to the below code
    import java.text.SimpleDateFormat;
    import java.util.Date;
    public class DateFormatTest
    public static void main( String[] cmdArgs )
    throws Exception
    SimpleDateFormat sdfInput =
    new SimpleDateFormat( "yyyy-MM-dd" );
    SimpleDateFormat sdfOutput =
    new SimpleDateFormat ( "EEE, d MMM yyyy hh:mm aaa" ); //Change the patterns in to what ever u need
    String textDate = "2001-01-04";
    Date date = sdfInput.parse( textDate );
    System.out.println( sdfOutput.format( date ) );
    i will suggest u to look in to the API doc you will come to know lot many things.

  • VBA:comboboxes to present same date in different formats...ADAPT WITH CHANGE IN DATE

    Hi all, 
    I'm very new to VBA and excel development, so please take that into consideration as you read on.
    I'm trying to create a work form for a database that (should) collect various information in comboboxes, including the date, the weekday, and the month... Note: most of the time, the data will be inserted the day after it's been collected. So, I wanted to create
    one combobox for the date, one for the weekday, and one for the month, because I want columns for each of these in the database (If this is not necessary/efficient, please help! :) ) . 
    Here's what I've got so far:
    'worksheet setup
    Dim ws As Worksheet
    Set ws = Worksheets("LookupList")
    'Date dropdown setup
    Dim cDateToday As Range
    For Each cDateToday In ws.Range("DateList")
    With Me.cboDate
    .AddItem cDateToday.Value
    End With
    Next cDateToday
    'If today is Monday, then set date to last friday, if any other weekday, set it to day before that
    If Weekday(Date - 1) <> 2 Then
    Me.cboDate.Value = Format(DateAdd("D", -Weekday(Date) - 1, Date), "Medium Date")
    Else
    Me.cboDate.Value = Format(Date - 1, "Medium Date")
    End If
    Problem #1: Right now, I am getting the date values from the list
    DateList in the worksheet LookupList...is there a better way of doing this?
    Problem #2: When the user form is run, the correct date and format shows up. However, if I change the date, the dropdown list in the combobox starts from the initial date in given list...is there anyway to bring the list closer to the current
    date? Think Calendar View
    Problem #3: I want the weekday and month values to be directly correlated to the date value discussed above, so hypothetically when the user form is run the correct date, weekday, and month all show up (based on the same date value), then if
    I change the date, the weekday and month automatically update. Is this possible, if so how?
    The reason I want this functionality is so that on a Monday, I can run the work form and it will automatically have Friday's date, weekday, month info as it opens. When I'm done with Friday, I can run it again, switch the date to the Saturday's
    date (weekday and month automatically update), then repeat for Sunday.
    I have tried running the same code for the weekday and month as I have for the date, and they work
    until the date is changed. Once the date is changed, I have to manually change the weekday, which leads to format change, and same for month, which all leads to :( and confusion
    Again, I am very new to vba and don't know much about it all and appreciate any/all help!
    Thanks in advance!
    /Alex

    I can give you a little advice but I don't understand your comment "if I change the date, the weekday and month automatically update" Where do you want them to update?
    I am assuming that your entire question is referring to a Userform with the Combobox. Is this correct?
    The code can be much simpler to populate the combobox list. You already have a named range for the Dates so you can use that directly to populate the RowSource. (RowSource if the combox is on a Userform or ListFillRange for a combobox on a worksheet).
    Then the WorksheetFunction Workday can be used to get the previous workday without weekend days. It also looks after the previous day when the actual date is mid week. Look up the function on the worksheet Help because you can also have a separate list
    of holidays that will be excluded like weekend days.
    If you are new to VBA then a tip about Help. You need to be on the worksheet and click Help to get worksheet help and in the VBA editor you click Help to call the VBA help. Don't just select Help off the taskbar when changing between the worksheet and VBA
    because you will finish up with the incorrect Help file.
    Example of code to assign a named range to the RowSource of a ComboBox. Named range needs to be Global and not scoped to a worksheet otherwise the worksheet name is also required. 
        Me.cboDate.RowSource = "DateList"
    Example of code to assign the previous workday to the combobox value.
        'Following line sets value to previous workday (Mon to Friday)
        Me.cboDate.Value = WorksheetFunction.WorkDay(Date, -1) 
    Then there is another problem with ComboBoxes and dates. If the Dates are real dates on the worksheet (Not Text)  then the dropdown list displays in the same format as the worksheet but when the date is selected, it displays as a serial number. This
    can also be rectified with code but first I need to know what the format of the data is on the worksheet.
    Can you upload a copy of your workbook because it is like a picture is worth a thousand words. Same goes for having a copy of the workbook. If it has sensitive data then create a copy and remove the sensitive data.
    Regards, OssieMac

  • How do I change the date format?

    Sorry, but I'm new to Oracle!
    I'm using "sqlplusw" to build my SQL statements. When I return columns that are date fields, I get the DD-MON-YY format. I want dates to be returned in "YYYY-MM-DD HH24:MI:SS". My DBA won't change the date format on the server, so how do I change SQLPLUS to return dates in the format I want? Do I need set this in some kind of startup file, or a reg key?
    Using client version 9.2.0.5 against a 9.2.0.1 server
    Jeff

    There are a couple of ways you could do it.
    Way 1:
    Search for a file by name 'glogin.sql' on your client work station and add the following statement
    alter session set nls_date_format = 'YYYY-MM-DD HH24:MI:SS';Make sure you save the file. This change will apply to all users who will log into the database using SQL*PLUS from your machine.
    Way 2:
    Create a shortcut and place it some where (for example on the 'DESKTOP').
    Right click on the short cut and choose properties.
    Change the text corresponding to the 'Start in' box to reflect the current location of the shortcut.
    Create a file by name 'login.sql' and place it in the same folder as the shortcut.
    Edit the file and add the following line.
    alter session set nls_date_format = 'YYYY-MM-DD HH24:MI:SS';Make sure that you save the file.
    When you double click the shortcut to start SQL*Plus and login, the script 'login.sql' is executed.

  • How do you change the date and time format in Pages

    I've tried changing the date and time format a number of times for Pages but it does not change.  I'm going to the System Preferences/Language and Text and Formats.  I make the changes click on OK and go back to Pages.  NO change.

    Hi Uncle,
    Page 116 of the Pages'09 User Guide: Control Click the date, Edit Date and Time.
    Date and time can also be in a table. Format the table cell.
    The User Guide is well worth a read. Download it from the Help menu in Pages.
    Regards,
    Ian.

  • Formscentral - how do I change required date format to long date (e.g. January 2, 2014) in a form field?

    Formscentral - how do I change required date format to long date (e.g. January 2, 2014) in a form field?  I can't seem to change it from the short date format.

    Hi,
    I would suggest you to change the form language to English (UK), Here are the steps:-
    1. Open your form in FormsCentral
    2. Clik on Options tab
    3. Click on Language and Formatting and check out the selection for Form Language and make sure English (U.K.) is selected and the default date format should be day/month/year.
    Regards,
    Nakul

  • Change display Date format from 06.2011 to june 2011 in output of Query

    Hi All,
                Change display Date format from 06.2011 to june 2011 in output of Query  Execution. i used time charcteristics 0calmonth in query, output display is coming 06.2011, i want to display output in june 2011 format, anyone tell me how to convert this Date format.

    Hi Nandish,
    as tibollo said you just need to mark 0CALMONTH with text in RSD1.
    Kindly note that you don't need to do data load for this object.
    It will automatically derive by system.
    Just change the Info object 0CALMONTH in RSD1, Go to Master Data/text column and check mark on with text.
    Then activate it.
    Regards,
    Ashish

  • How to change the date format in xml form?

    hi,
    How to change the date format in xml form?
    For example:  11/20/2008 3:00:03 PM    ->   11-20 03:00
    Any opinions greatly appreciated!
    Thanks.
    Edited by: ke wenxing on Dec 2, 2008 8:33 AM

    You could go to System - User Profile - Own Data would take you to the "maintain user profile screen"
    Click the defaults button and change the date format.This changes date format for all the dates in your login.

Maybe you are looking for

  • In ABAP+Java system installation

    Hi, I installed ABAP+Java system On that i installed XI 3.0 SR1.I after applying the J2EERTOS11_0-20000118.SAR patch on J2EE engine.This patch consist of lot of bugs.I just stopped the installation of patch.After again when i log on to J2EE engine wi

  • Bw report iview template

    Hi All, I edited the properties of BW report iview template which is used for creation of bw report iviews when "role upload" is used. and it works fine. now, i created a template of my own bw report iview template and i want to default the "role upl

  • Photoshop CS6 & Doc Size & File Size???

    Working on a collage and have a relatively scall document, 6"x10" at 300dpi and used the Place command to add images and arrange and have 14 layers. The images were resized to fit using the Transform scale too. Was watching the document size at the l

  • Time Machine with Synology

    I am running Lion on iMAC witht he latest version.  I have browsed through most of the post and try everything but still getting the follwoing error: The network backup disk does not support the required AFP features. Open Time Machine preferences to

  • Did the Help Files Change?

    I have Flash 8 at work. But I was looking something up in the AS3 LiveDocs online and noticed that every class entry now has a little dropdown button to show/hide inherited properties, methods, events. I'm pretty sure this wasn't in the built in help