How To Format Sysdate

How do you format sysdate? I want the results to be in date format, but I only want the date itself without the time added as
6/14/2010
The To_Date function doesn't seem to work as it converts a string to a date and sysdate isn't a string?
Thanks for any help..

user12296489 wrote:
Turns out that I can specify to change the format from text to date when I import the data into access. So, after using To_Char to save the data in mm/dd/yy text format, I can import that, changing it to date format upon the import..That sounds like the correct thing to do.
You have to remember, when you talk about "format", you are talking about how something is displayed or output and that means you are talking about strings. Only character based datatypes are strings (VARCHAR2, CLOB) and the other datatypes are internal representations that have to be formatted to strings to be displayed.
For examples, if I look at the string 'FRED'...
SQL> select 'FRED', dump('FRED') as dmp from dual;
'FRE DMP
FRED Typ=96 Len=4: 70,82,69,68You can see that it's stored internally as 4 bytes each of which are the ascii values of the 4 characters in the string. There's no formatting needed as it's already a direct representation of the ASCII characters needed to display it.
However, if I look at sysdate...
SQL> select sysdate, dump(sysdate) as dmp from dual;
SYSDATE             DMP
15/06/2010 08:28:04 Typ=13 Len=8: 218,7,6,15,8,28,4,0Whilst it displayes in DD/MM/YYYY HH24:MI:SS format, the internal storage of it is something completely different. It's made up of 8 bytes of data that sort of (but not fully) represent the number parts of the date, but contain non of the formatting that would display it as it appeared to me.
The format for the date comes from my local session settings, which tell it how to format it as a string. I can change this...
SQL> alter session set nls_date_format='DD-MON-YYYY';
Session altered.
SQL> select sysdate, dump(sysdate) as dmp from dual;
SYSDATE     DMP
15-JUN-2010 Typ=13 Len=8: 218,7,6,15,8,32,44,0Now the date is displayed differently, but internally it's still represented by 8 bytes, that hasn't changed.
So, if you want to format dates, or numbers, you need to use the TO_CHAR function and specify the format it should be displayed in. You can use the NLS settings, but they are session specific and you would need to be careful using them. It's always better to be explicit about the format you want using TO_CHAR instead.

Similar Messages

  • How to convert sysdate to the format dd-mon-yyyy

    how to convert sysdate to the format dd-mon-yyyy

    <how to convert sysdate to the format dd-mon-yyyy>
    This question is better answered by thinking about about how Oracle dates work. SYSDATE is a pseudocolumn (function without any arguments) that returns a date value: it already is a date. Oracle date values are stored not as we see them, say 'DD-MON-YY', but as a series of bytes with the different date components from the millennium down to the second. We NEVER see dates as they are stored but use the formats for automatic conversion.
    To display a date the way you want use TO_CHAR() with an edit mask or as others suggested change your NLS_DATE_FORMAT (thought I advise against this as most systems use DD-MON-YY and porting queries from other systems or even OTN can easily break). To change a converted string back to a date use TO_DATE() with an edit mask.

  • How to format my MacBook Pro?

    How to format my MacBook Pro? I want to format my mac, help.

    Restart with the Command and R keys held down, use the Disk Utility on the recovery partition to erase the main one, and install a new OS.
    (76312)

  • How to format my macbook pro and I dont have my lion cd or usb stick?

    How to format my macbook pro and I dont have my lion cd or usb stick?

    try this
    http://support.apple.com/kb/HT3294http://support.apple.com/kb/HT3294
    http://support.apple.com/kb/TS4265http://support.apple.com/kb/TS4265
    If you don't have the original PSWD, your beat, so tough if your a kid trying to be a kid

  • How to format new hard drive for Apple TV when you can't use old HD

    I need to know how to format a new HD to install in my Apple TV where I can't use the old HD to clone or otherwise create the new structure on the new HD.
    I have an Apple TV that was syncing to a Mac Mini that had a defective HD and logic board. I was unable to backup the Apple TV to the Mac Mini for some time before I had the mini repaired by AppleCare.
    When the mini came back, it registered on the Apple TV as a new computer and I couldn't sync with it without losing hundreds of dollars of content.
    All was okay until the other night when Apple's defective update for the ATV erased ALL my content. I updated it to 3.1 this morning, which Apple indicated might fix the problem. It didn't. The old content is all gone.
    My ATV is out of warranty, so I removed the old HD and copied the files from the "Purchased" folder to my mini. That saved most 101 items that I purchased since 12/08 (but not all for some reason). I lost all content prior to 12/08 that I purchased, as well as some content since 12/08 that I purchased.
    I need to keep the old HD untouched until I can purchase data recovery software. I'd like to just put a spare IDE HD in that I have into the ATV and just start over with what is in my Mac mini iTunes.
    So, how does one do that? I'm not gifted with vast Unix knowledge or experience and I don't want to clone the old HD and risk losing more data if it writes to the HD for some reason.
    Thanks.

    Hi Atagahi,
    Firstly, have you emailed Apple iTunes support indicating your issue? There have been instances in which Apple will allow re-downloading of all content you've purchased on the iTunes store.
    Secondly, I highly recommend you get an external usb hard drive, attach it to your mini and use it as a Time Machine drive to keep your iTunes purchases safe. It's a fact of life that all hard disk drives will eventually fail. The Apple TV should never be used as any kind of permanent storage space; think of it as a 'temporary holding' zone. And as you've unfortunately already experienced, a glitch wiped out all content on the Apple TV.
    As regards your original question, it seems like there have been folks who've done just that...taken the internal drive in the Apple TV out and attached it to a mac and copied files from the Apple TV hard drive. I have not had to do such, so I cannot offer any help here except for Linda's suggestion on googling the net for solutions.
    Good luck and hope you get all your purchased content back Atagahi!
    Message was edited by: Alec

  • Can someone please tell me how to format a new disk to ZFS format?

    I have a Sun v240 with Solaris 10 update 8 installed on a single 73GB harddisk. Everything is working fine. I just purchased a another identical harddisk online. I plugged the disk into my v240 and ran 'devfsadm' and solaris found the new disk. I want to add this disk to my existing ZFS pool as a mirror. However, this disk was originally formatted with a UFS file system. So when I run:
    zpool attach rpool c1t0d0 c1t1d0I get:
    /dev/dsk/c1t1d0s0 contains a ufs filesystem.I understand the error message but I don't know how to format the disk to have a ZFS file system instead. Note that I am extremely new to Solaris, ZFS, and pretty much everything Sun - I bought this server on eBay so that I could learn more about it. It's been pretty fun so far but need some help here and there.
    For some reason I can't find a single hit on Google telling me how to just simply format a disk to ZFS. Can I use the 'format' command? Maybe you don't "format" disks for ZFS? I have no idea. I might not have the right terminology. If so, apologies. Can anyone help me on this?
    Thanks a lot! =D
    Jonathon

    Yes, you were right. The partitions were totally different. Here is what I saw:
    For c1t0d0:
    # format
    Part      Tag    Flag     Cylinders         Size            Blocks
      0       root    wm       0 - 14086       68.35GB    (14087/0/0) 143349312
      1 unassigned    wm       0                0         (0/0/0)             0
      2     backup    wm       0 - 14086       68.35GB    (14087/0/0) 143349312
      3 unassigned    wm       0                0         (0/0/0)             0
      4 unassigned    wm       0                0         (0/0/0)             0
      5 unassigned    wm       0                0         (0/0/0)             0
      6 unassigned    wm       0                0         (0/0/0)             0
      7 unassigned    wm       0                0         (0/0/0)             0For c1t1d0:
    # format
    Part      Tag    Flag     Cylinders         Size            Blocks
      0       root    wm       0 - 12865       62.43GB    (12866/0/0) 130924416
      1       swap    wu   12866 - 14079        5.89GB    (1214/0/0)   12353664
      2     backup    wm       0 - 14086       68.35GB    (14087/0/0) 143349312
      3 unassigned    wm   14080 - 14086       34.78MB    (7/0/0)         71232
      4 unassigned    wm       0                0         (0/0/0)             0
      5 unassigned    wm       0                0         (0/0/0)             0
      6 unassigned    wm       0                0         (0/0/0)             0
      7 unassigned    wm       0                0         (0/0/0)             0So then I ran the following:
    # prtvtoc /dev/rdsk/c1t0d0s0 | fmthard -s - /dev/rdsk/c1t1d0s0
    fmthard:  New volume table of contents now in place.Then I rechecked the partition table for c1t1d0:
    # format
    Part      Tag    Flag     Cylinders         Size            Blocks
      0       root    wm       0 - 14086       68.35GB    (14087/0/0) 143349312
      1 unassigned    wu       0                0         (0/0/0)             0
      2     backup    wm       0 - 14086       68.35GB    (14087/0/0) 143349312
      3 unassigned    wu       0                0         (0/0/0)             0
      4 unassigned    wu       0                0         (0/0/0)             0
      5 unassigned    wu       0                0         (0/0/0)             0
      6 unassigned    wu       0                0         (0/0/0)             0
      7 unassigned    wu       0                0         (0/0/0)             0Woo-hoo!! It matches the first disk now! :)
    Then I tried to attach the new disk to the pool again:
    # zpool attach -f rpool c1t0d0s0 c1t1d0s0
    Please be sure to invoke installboot(1M) to make 'c1t1d0s0' bootable.
    Make sure to wait until resilver is done before rebooting.
    bash-3.00# zpool status
      pool: rpool
    state: ONLINE
    status: One or more devices is currently being resilvered.  The pool will
            continue to function, possibly in a degraded state.
    action: Wait for the resilver to complete.
    scrub: resilver in progress for 0h0m, 0.40% done, 0h58m to go
    config:
            NAME          STATE     READ WRITE CKSUM
            rpool         ONLINE       0     0     0
              mirror-0    ONLINE       0     0     0
                c1t0d0s0  ONLINE       0     0     0
                c1t1d0s0  ONLINE       0     0     0  30.3M resilvered
    errors: No known data errorsBoo-yah!!! ++Does little dance++
    Then, after resilvering completed I ran:
    # installboot -F zfs /usr/platform/`uname -i`/lib/fs/zfs/bootblk /dev/rdsk/c1t1d0s0I think I'm starting to understand this now. I also shutdown the server to the OpenBoot prompt and booted off of the new disk and it worked! Also, my bootup time to login has drastically decreased - I would say it's about half the time it was before I added the mirror disk. So I believe the server is properly reading from both disks simultaneously in order to get better bandwidth. Cool! :)
    Thanks for the help!
    Jonathon

  • How to FORMAT a number field in Formula editor

    Dear All,
    I have a "QUANTITY" field in database which has to get displayed in the report as " QTY : " that  will look like QTY : 54.
    Where as now it coming as QTY : 54.00
    So, how to format this field in the Formula Editor while concatenation of
    "QTY : " + CStr()
    If any one has any idea please help me out.
    Thanks and regards.

    Hi friends,
    Thanks to all of you that you all have replied my question and given your answers.
    Thanks to all of you specially Alpana Phapale, Wallie Chang, Poonam Thorat and Raghavendra Gadhamsetty, the answers given by you is the perfect one may be in different ways and only one can be used by me. But your answers were exactly correct.
    Thanks to Asha Lund, your answers is also correct but the result as per my report should be in figures and not in words.
    Whatever it may be but for repling thanks to you too.
    Please be always with me, I am very new to Crystal Report and just learnt by my own as my Boss ordered me to do this and I have to make about 50 reports within 15 days. I think the day will start from today.
    Well friends thanks a lot again for all your effort.

  • cfinsert tablename attribute, how to format for Oracle

    I've been using <cfquery> successfully for a long time
    to do table inserts, but now I'd like to use <cfinsert> for
    the simple inserts. However, I'm getting error messages. A typical
    <cfquery> against my Oracle database would look like:
    <cfquery name="myQuery"
    datasource="#application.DataSource#">
    INSERT into abc.action_type_def (field1, field2, field3)
    VALUES ('value1', value2'', value3'')
    </cfquery>
    I tried the following <cfinsert> but got the error
    message that follows the tag:
    <cfinsert datasource="#application.DataSource#"
    tablename="ABC.ACTION_TYPE_DEF"
    formfields="FIELD1, FIELD2, FIELD3">
    ERROR:
    Message: There are no columns found for the given table name
    "PRFA.ACTION_TYPE_DEF".
    Detail: This error may be caused by not specifying the table
    name in the format that the database server expects. (For example.
    Oracle Server table name must be upper case or the Server table
    name must be qualified in the format of "schema.table_name". For
    the SQL Server, the format is "databasename.username.tablename",
    such as in customers.dbo.orders)
    I've tried upper and lower case on the tablename attribute,
    tried leaving the "abc." off, but I just can't seem to get it to
    work. Any idea how to format this tag to go against an Oracle
    database?
    Thanks! Pam

    Word of advice: I would stay away from using cfinsert and
    cfupdate tags, unless you are prone to masochistic tendencies and
    enjoy pain and suffering. These tags are notoriously bug-prone, and
    cause more work than they save. Just my opinion, but I'm sure that
    it is one shared by many on these forums.
    Having said that, you might take a look at the attributes for
    this tag, as you seem to have combined the schema (table owner)
    with the table name, as in ABC.ACTION_TYPE_DEF, which should be
    listed distinctly using separate attributes, namely tableOwner and
    tableName respectively. Note: I don’t use these tags so this
    “fix” is just based on reading the
    LiveDocs
    for this tag.
    Since you have so much more control using cfquery, and you
    said that you have been using it for quite some time, why switch to
    using cfupdate/cfinsert? If you already know enough SQL to do an
    insert or update , then you really don't need to use these tags.
    You will thank me.
    Phil

  • Fresh installed, unformatted drive - how to format

    I just bought a SSD and it will arrive in a few days, but I still can't find a clear answer about how to format an unformatted drive. The only answer I can find is to use the installaion disk, I don't have that. I am running mountain lion and can make a flash drive boot, but I can't figure out how to boot from flash. I wanted to know if anyone knew if I can boot by using CMD + R on an unformatted drive to format it? Or anybody know a command that I can use to boot from flash drive?

    The easiest way is to get yourself an enclosure for the drive. Here's one example:
    http://www.tigerdirect.ca/applications/SearchTools/item-details.asp?EdpNo=319523 3&CatId=2781
    1. To begin temporarily install the ssd in the enclosure - it should just slide in. You now have an external ssd drive.
    2. Connect it to your computer and use Disk Utility to format it as Mac OS Extended. (DU is in Applications / Utiities.)
    3. Transfer whatever you want from the internal to the external using an app like Carbon Copy Cloner.
    4. Check the external is bootable by looking at System Preferences / Startup disk.
    5. Take the ssd out of the enclosure and install it in the Mac.
    And you can put the original drive in the enclosure, as a bonus.

  • How to format "My Passport" for Time Machine

    I have purchased a 1TB Western Digital My Passport Drive (an external drive connected via USB).  How should I format this drive to use it with Time Machine?
    I'm running OSX 10.6.8 on an Intel iMac (hardware circa 2005).  I have been using Time Machine for several years, rotating through external disks.  Thie new disk will replace one of the previous disks which has failed.  I have forgotten how I formatted the previous disks.  I'm primarily interested in whther to use HFS or whatnot.  As to partitioning, the format will just be one partition for the whole disk.
    I'm going to see if I can figure this out using Disk Utility, but in the mean time, does anyone have recommendations?
    Thanks in advance,
    Frank

    Drive Preparation
    1. Open Disk Utility in your Utilities folder.
    2. After DU loads select the WD Passport drive (entry with the mfgr.'s ID and size) from the left side list. Click on the Partition tab in the DU main window.
    3. Under the Volume Scheme heading set the number of partitions from the drop down menu to one. Click on the Options button, set the partition scheme to GUID then click on the OK button. Set the format type to Mac OS Extended (Journaled.) Click on the Partition button and wait until the process has completed.
    4. Select the volume you just created (this is the sub-entry under the drive entry) from the left side list. Click on the Erase tab in the DU main window.
    5. Set the format type to Mac OS Extended (Journaled.) Click on the Security button, check the button for Zero Data and click on OK to return to the Erase window.
    6. Click on the Erase button. The format process can take up to several hours depending upon the drive size.

  • How to format a pendrive in macbook pro

    how to format a pendrive in macbook pro

    k then ill try
    On Fri, Aug 29, 2014 at 5:43 PM, Apple Support Communities Updates <

  • Don't know how to format external hard drive

    dont know how to format my new external hard drive can anyboby help me not very good with computers   thanx

    http://osxdaily.com/2012/01/04/format-an-external-hard-drive-or-usb-flash-drive- for-mac-os-x/
    http://reviews.cnet.com/8301-13727_7-57600320-263/using-external-drives-to-save- space-on-your-mac-format-them-first/
    http://pondini.org/OSX/DU1.html

  • How to format 9 or 11 digit number with dashes

    Windows Adobe Pro 9.
    Someone please be kind and have mercy on me, I've researched this issue for 5 hours now and cannot resolve it on my own.
    I have a text field where the user will enter either a 9 digit or 11 digit number separated with dashes. If the number entered is 9 digits, it should appear as
    XX-XXXXXXX. If 11 digits, it should appear as XX-XXXXXXX-XX. If only 9 digits are entered, the -XX at the end must be omitted.
    I found a javascript that showed how to allow a varying number of digits, and I also found one that showed how to cause the dash to be entered, but I'm not smart enough to know how to combine the two. I've only used one other javascript before (how to format the time 12:00 am, with a gigantic thanks to Mr. George Johnson), so I know that I must put the script in "Advanced > Document Processing > Document JavaScripts." I think then I would go into the text field format and select "custom," and enter a keystroke and format script???
    Any help will be greatly appreciated.
    thanks
    alice

    Hi Mr. Johnson,
    When I copied the first part of the code into the document-level javascript editor box and hit okay, it gives this message:
    SyntaxError: return not in function
    8: at line 9
    and the cursor moves to the empty line after:
       // Do nothing if field is blank
        if (!s) return;
    Is there something missing?
    I really appreciate your help.
    alice

  • How to format a text object

    Post Author: ftpaxa
    CA Forum: Other
    I use a SQL server DataBase on Windows server 2003 with service pack 2. i use Crystal Report 10 with ODBC connection. I read that the nice DLL is "Crdb_odbc.dll".I saw a VB code "How to format a text object" on this site :http://technicalsupport.businessobjects.com/KanisaSupportSite/search.do?cmd=displayKC&docType=kc&externalId=crxiTechrefenpdf&sliceId=&dialogID=7686352&stateId=1%200%207680692--' Create a new instance of the report.Dim oReport As New CrystalReport1Private Sub Form_Load()' Declare a TextObject object.Dim oTextObject As CRAXDRT.TextObject' Declare a generic Object.Dim oObject As Object' Declare a Section object.Dim oSection As CRAXDRT.Section' This variable is set to true once the' text object is found.Dim bText As BooleanbText = False' Search for all the report objects in each section.For Each oSection In oReport.SectionsFor Each oObject In oSection.ReportObjects' Find the first text object.If oObject.Kind = crTextObject Then' Get the text object and exit the loop.Set oTextObject = oObjectbText = TrueExit ForEnd IfNext oObjectIf bText Then Exit ForNext oSection' Format the text object and change the text.With oTextObject.BackColor = vbYellow.BorderColor = vbRed.BottomLineStyle = crLSDoubleLine.CanGrow = True.CharacterSpacing = 125.CloseAtPageBreak = True.FirstLineIndent = 25.Font.Italic = True.Font.Bold = True.Font.Size = 14.HasDropShadow = True.Height = 900.HorAlignment = crLeftAlign.KeepTogether = True.Left = 200.LeftIndent = 750.LeftLineStyle = crLSDashLine.MaxNumberOfLines = 16.RightIndent = 250.RightLineStyle = crLSDotLine.Suppress = False.SuppressIfDuplicated = True.SetText "Hello World".TextColor = vbBlue.TextRotationAngle = crRotate0.Top = 25.TopLineStyle = crLSSingleLine.Width = 3000End With' Set the report source of the viewer and view the report.CRViewer1.ReportSource = oReportCRViewer1.ViewReportEnd SubSo, i would like to do the same thingswith winbatch language. I tried this code :;Get CrystalRuntime Application Object HandleobjCra = ObjectCreate("CrystalRuntime.Application");Logs on to on or more SQL servers or ODBC data sources.objCra.LogOnServer("Crdb_odbc.dll","Magic","xxx","xx","zzzz") ; ("DLL file", "Server", "dbname", "username", "password"); open the saved reportobjReport = objCra.OpenReport("C:\Download\Perso\Programmation\Winbatch\Crystal Report\Final\rapport exploitation - abend.rpt")objReport.DiscardSavedData()TxtObj = objReport.Sections("PHb").ReportObjects("Text11")txtObj.Text = "testing" ; *** Error on this line : 1266: Ole:Bad Param Count;Export htmlPathHTML = strcat("C:\Download\Perso\Programmation\Winbatch\Crystal Report\Final\Resultat\rapport exploitation - abend.htm")hfile = PathHTMLcre = crr.ExportOptionscre.DestinationType = 1 ; diskfilecre.FormatType = 32 ; 24 = (HTML 3.2 standard), 31 = (PDF), 32 = (HTML4.0) cre.HTMLFileName = hfilecrr.Export(BOOL:@false)objectclose(cre)objectclose(objReport)objectclose(objCra)exit--
    Everythings work good except this linetxtObj.Text = "testing" I receive this error :1266: Ole:Bad Param CountI may be don't have the nice recipe. If you have a solution, it is welcome.

    Post Author: KAM
    CA Forum: Other
    Try using SetText.  Thanks.

  • How to format a form with adf

    Hi,
    I want to format an adf form like this :
    http://dl.dropbox.com/u/33421977/adf_form.PNG
    To do this I have used af:panelDashboard and af:panelBox with af:panelFormLayout inside.
    Now I don't want to use panelBox anymore, but I don't know how to achieve this without panelDashboard/panelBox.
    What is th best aproach to do this? Can you send me some links which explain how to format a form with adf?
    Thanks.

    Is just a question of style. In the real application this form is included in another panelBox. So it looks too... I don't know how to say it... too heavy?
    In fact I don't want to see these panelBoxe's borders. Maybe I have just to change the style of these boxes? Do you know if it is possible?
    But more generally, what is the right way to format adf forms? Can I achieve this sort of formatting just using panelFormLayout?

Maybe you are looking for

  • 10.6.8 Upgrade Problems with Google Display Error post install

    Hi -- I just upgraded my IMac to 10.6.8 in anctipation of migrating to Mountain Lion later this week.   While the installation went very smoothly, it seems I am having a problem with the Google display.    When I open Google, the search box has no li

  • Attachement of word doc in sales order

    Hii, I have one query that i want create contract,for the proof of the contract my cleint have word doc., Now they want to add it in my contract so any time it can check that approval word doc. Pls give suggestion on that.

  • Leopard and G4 performance

    I'm thinking of upgrading to Leopard, but concerned that it might slow things down a bit, as my G4 only has 500mb RAM. Any opinions?

  • Mobileme album not created

    Hello, i created a mobileme album in aperture but it is not published in the mobileme gallery. tried sev. times, but aperture does not even show a URL for the album in mobileme menue. Last time i created a mobileme album was wih aperture 2 now using

  • TS1424 songs are not complete get cut off at the end

    I downloaded this album but some of the songs are not complete they get cut off at the end what can i do?