Viewing and Removing the Time part of the Date field

Hi,
I have Date field in a table.
but in SQL plus when I do
select date from table
this gives me only the Date values and not the timestamps in the date.
I believe Oracle stores 'Date' and 'Time' in fields with Data Type 'Date'.
How do I print the timestamps also in the SQL query?
Moreover, if I have to extract the date field, reset the timestamp to 00:00:00, and store back the date field (with 00 time), how do I do that?
Thanks in advance
- Manu

Hi,
If you want to retry date and time you can:
SELECT TO_CHAR(DATE,'YYYY/MM/DD HH24:MI:SS') FROM TABLE;
If you want truncate time when inserting in a table simply use TRUNC function
INSERT INTO TABLE (DATE) VALUES (TRUNC(YOUR_DATE));
To extract and insert with time 00:00:00
INSERT INTO TABLE1 (SELECT TRUNC(DATE) FROM TABLE2);
I hope this help you.

Similar Messages

  • Toplink resets the time part of the date

    Hi,
    Using Toplink (DirectToFieldMapping with java.util.Date), while retrieving date information from the DB, the time values are zeroed out (Eg: Fri May 16 00:00:00 IST 2008).
    This is happening only when using JDBC thin drivers whereas OCI drivers retrieve the time values properly (Fri May 16 12:30:08 IST 2008).
    I tried various versions of ojdbc14.jar and found no difference.
    Any help would be appreciated.
    Thanks for your time..

    Timestamp insert problem
    V8CompatibleFlag did the trick

  • This can't be right - can't display time part of a DATE field.

    Hi all,
    I have a table with one DATE field. It wasn't displaying times with the date,
    so I searched and found a post telling how to change my NLS settings
    in the Preferences.
    I did this and it didn't change, so I thought, OK, I'll shut it down and restart.
    Still no. So, I shut it down again, deleted all the records form my table, reinserted
    them and then restarted SQLDeveloper.
    Despite the fact that it has retained the change in NLS settings, it STILL*
    doesn't display the time.
    There is no problem in SQL*Plus. Quite frankly, this is poor.
    Paul...

    >
    Would there by anything else - I'm planning on rebooting the machine this afternoon - maybe
    that'll do the trick? Will report back.Now, this is still wierd! Have rebooted machine.
    I have two tables Sysstat_ext and Sysstat - both have fields M_Time (Measurement time),
    which is VARCHAR2(15) in Sysstat_ext and DATE in Sysstat.
    Sysstat_ext is an external table pointing at a .csv file where the dates are strings (obviously) in
    the format DD-MM HH24:MM:SI (i.e. 01-09 13:55:02).
    I then insert the data from Sysstat_ext into Sysstat - the conversion being performed thus:
    INSERT INTO Sysstat
    SELECT ROUND(TO_DATE  (Sysstat_ext.M_Time, 'DD-MM HH24:MI:SS'), 'MI') AS "Measurement Time",
    <.. other fields deleted>If from SQL*Plus, I select M_Time from Sysstat
    SQL> select M_Time from Sysstat;
    M_TIME
    2011 09 01 00:00:00
    2011 09 01 03:20:00perfect
    same for Sysstat_ext
    SQL> select M_Time from Sysstat_ext;
    M_TIME
    01-09 13:55:02
    01-09 14:00:01No year - the conversion during the insert obviously implicitly gives this year (good job that's what I actually want!).
    I look at the dates in SQLDeveloper
    Systat_ext: 01-09 13:55:02 <====== exactly what I'd expect
    Systat: 01-SEP-11 <====== where has my time gone?
    Anyone care to shed some light on this?
    So, I redid the whole procedure removing the ROUND and also the AS "Measurement Time" (in case of artefacts)
    INSERT INTO Sysstat
    SELECT TO_DATE (Sysstat_ext.M_Time, 'DD-MM HH24:MI:SS'),
    <... deleted...>
    Still the same result - Sysstat_ext shows the time and Sysstat doesn't. I would have expected the
    opposite. SQL*Plus still shows a time with Sysstat.
    This is definitely a bug IMHO. Can I report it anywhere? As an aside, I originally thought that 3rd party tool
    manufacturers such as Quest and Allroundautomations would be quaking in their boots with a
    tool like SQLDeveloper (for free*) coming from the manufacturer of Oracle itself - I see now that
    at the moment, they have little to worry about.
    Paul...

  • Adding one day to a oracle.jbo.domain.Date and truncating the time part

    JDev 11.1.1.4.0
    Hello
    I need to add a day to oracle.jbo.domain.Date and get back a oracle.jbo.domain.Date without the time part.
    So far I've got
    Date valueDate = (Date)rowCpt.getAttribute("ValueDate");                                       
    Calendar cal = Calendar.getInstance();
    cal.setTime(new java.util.Date(valueDate.timestampValue().getTime()));
    cal.add(Calendar.DATE, 1);
    Date newDate = new oracle.jbo.domain.Date(new Timestamp(cal.getTime().getTime()));This adds 1 day to the date but keeps the time part of the date.
    How do I get rid of the time part of the date ?
    Thanks
    Paul

    The Calendar class allows you to set or clear each field.
    Date valueDate = (Date)rowCpt.getAttribute("ValueDate");                                       
    Calendar cal = Calendar.getInstance();
    cal.setTime(new java.util.Date(valueDate.timestampValue().getTime()));
    cal.add(Calendar.DATE, 1);
    cal.clear(Calendar.HOUR);
    cal.clear(Calendar.MINUTE);
    cal.clear(Calendar.SECOND);
    cal.clear(Calendar.MILLISECOND);
    Date newDate = new oracle.jbo.domain.Date(cal.getTimeInMillis());should work.
    Timo

  • LIKE Operator to ignore the time part of DATE type?

    Hi,
    is it allowed to use the LIKE operator on DATE Type to ignore the time-part in the DATE?
    Nothing found in the manual, but seems to me that it works.
    1. SELECT * FROM test_date WHERE tst_date LIKE to_date('01.01.2003 13:33:33','DD.MM.YYYY HH24:MI:SS') ;
    2. SELECT * FROM test_date WHERE tst_date LIKE to_date('01.01.2003','DD.MM.YYYY') ;
    3. SELECT * FROM test_date WHERE tst_date LIKE trunc(to_date('01.01.2003 00:00:00','DD.MM.YYYY HH24:MI:SS'));
    4. SELECT * FROM test_date WHERE to_date('01.01.2003 13:33:33','DD.MM.YYYY HH24:MI:SS') LIKE tst_date;
    5. SELECT * FROM test_date WHERE tst_date BETWEEN to_date('01.01.2003 00:00:00','DD.MM.YYYY HH24:MI:SS') AND to_date('01.01.2003 23:23:59','DD.MM.YYYY HH24:MI:SS');
    6. SELECT * FROM test_date WHERE tst_date >= TO_DATE('01.01.2003 00:00:00','DD.MM.YYYY HH24:MI:SS') AND tst_date < TO_DATE('01.01.2003')+1;
    7. SELECT * FROM test_date WHERE TRUNC(tst_date) = TRUNC(TO_DATE('01.01.2003 00:00:00','DD.MM.YYYY HH24:MI:SS'));
    Result for 1-7 is the same.
    What is the preferred Solution?
    Solution 5 is bad, because index on TST_DATE column could not be used.
    Solution 1 - 3 is the same using the LIKE operator.
    Any comments?
    Thanks, Markus
    GEMS IT

    Oh, sorry, LIKE-Operator solutions do also not use an Index :-(. Only 5. and 6.
    Sample-Script:
    CREATE TABLE TEST_DATE
    TST_DATE DATE
    CREATE INDEX MEDVIEW.TEST_DATE_IDX
    ON MEDVIEW.TEST_DATE(TST_DATE);
    INSERT INTO TEST_DATE ( TST_DATE ) VALUES (
    TO_Date( '01/01/2003 12:00:00 AM', 'MM/DD/YYYY HH:MI:SS AM'));
    INSERT INTO TEST_DATE ( TST_DATE ) VALUES (
    TO_Date( '01/01/2003 12:45:13 PM', 'MM/DD/YYYY HH:MI:SS AM'));
    INSERT INTO TEST_DATE ( TST_DATE ) VALUES (
    TO_Date( '01/01/2003 08:11:55 AM', 'MM/DD/YYYY HH:MI:SS AM'));
    INSERT INTO TEST_DATE ( TST_DATE ) VALUES (
    TO_Date( '01/01/2003 12:00:00 AM', 'MM/DD/YYYY HH:MI:SS AM'));
    INSERT INTO TEST_DATE ( TST_DATE ) VALUES (
    TO_Date( '01/01/2003 09:33:16 AM', 'MM/DD/YYYY HH:MI:SS AM'));
    INSERT INTO TEST_DATE ( TST_DATE ) VALUES (
    TO_Date( '01/02/2003 07:45:00 AM', 'MM/DD/YYYY HH:MI:SS AM'));
    INSERT INTO TEST_DATE ( TST_DATE ) VALUES (
    TO_Date( '01/02/2003 07:33:00 PM', 'MM/DD/YYYY HH:MI:SS AM'));
    COMMIT;

  • I have a crack in the back part of the macbook screen in the plastic and it is not caused by me it just cracked over time i was wondering if that would be covered in the $250 extra applecare warrenty?

    i have a crack in the back part of the macbook screen in the plastic and it is not caused by me it just cracked over time i was wondering if that would be covered in the $250 extra applecare warrenty?

    If it's a manufacturing defect, yes it would be covered. 

  • HT204088 I believe I got the short end of the stick due to the time I resolved the issue of a refund from Paypal and I lost the offer of an 25% discount on a $50 I-Tunes card, this have left me very anrgy with the issue.

    The issue is above, Iwas to buy an I-Tunes card of $25.00,but then wanted a $50.00, but due to I not processed a refund that I believed to be automatically, I could not purchase the I-Tunes card, because of the delay of finding what was wrong with the purchase with Paypal because of an refund that was issued due to a book that I did not recieve for two month of $5.00 and by the time I resolved the issue the offer was to late and for this reason  could not buy the $50.00 I-Tunes card and have decided not to buy any more I-tunes card at all, because I got the short end of the stick and I am very angry to the two companies.

    Thank you so much for helping,
    But i really wonder how you did that. did you always switch between design view and preview view, then change the key position for 2px then switch back, to align the four letters? because i imagine that can get really frustrating, if you have a logo consisting of 58 parts instead of 4!:)
    Anyway thank you very much for your time and effort!!!!

  • How to change the width and height of the visible part of the of the report

    I have define a report with paper size 'Letter', orientation 'landscape' and 30 columns. Dynamically I am changing width of columns and suppressing many columns of the report.
    Mostly using first 16-20 columns and others get suppressed.
    Now problem is that when navigating the report thru crystal viewer, a huge blank spaces getting display on right of the report. When we take jump to some part of report thru navigation tree, the whole report gets shifted to left and only blank part is visible and it is required to scroll left.
    Even printing is not working correctly.
    Is there any way to change the width and height of the visible part of the report in the viewer thru .net classes? Setting the width and height of the report in Load event handler doesn't help.  
    Example: CrystalReportViewer1.Width = 200; - is not helping.
    Is there any other solution?
    Please let me know.
    Thanks
    Mahesh Patel

    Hi Yogesh,
    Your suggestion 'reportDocument.PrintOptions.PaperSize=PaperSize.PaperLedger;' along with 'PaperOrientation' setting as follow works fine. I tried to switch between Landscape and Portrait depending on report width.
    reportDocument.PrintOptions.PaperOrientation = PaperOrientation.Landscape;
    But problem with crystal viewer remain as it is.
    While navigating report thru crystal viewer, when we take jump to some part of report thru navigation tree, the whole report gets shifted to left and it is required to scroll left.
    Thanks for your very good suggestion.
    Mahesh Patel

  • If I filled the system hard drive, and I'll delete anything on it, it's off and on the external drive, or can I safely clean the system hard drive and all that was done in the Time Machine in the same place, on an external hard drive and will remain ?

    Please help

    Time Machine does delete "old" backups, eventually.  "Eventually" is controlled by whether or not you have used all of the space on the TM drive.  If you have "more free space" on the TM drive, then nothing should be deleted yet.
    If youd elete files from a system drive, and continue on the same TM set, TM does NOT scour all old records to purge missing files ... else the "time" part of "Time Machine" makes no sense.

  • No major shortcomings keyboard arrow key. even if the text part of the message you clicked the arrow keys to update the screen would be great. with an update on my idea, and so it would be more useful

    no major shortcomings keyboard arrow key. even if the text part of the message you clicked the arrow keys to update the screen would be great. with an update on my idea, and so it would be more useful

    greghcrash wrote:
    It Would be great to have keys on the onscreen keyboard.
    Such as a computer keyboard.
    With BACKSPACE, TAB WITH SETTINGS, DELETE, TYPE OF TYPE, BOLD TYPE, UNDERLINE ETC....
    I HAVE A KEYBOARD COVER AND IF I NEED TO USE CERTAIN KEYS I HAVE TO SWITCH TO MY KEYBOARD CASE AND THAT IS VERY INCONVENIENT.
    IT IS ALSO A TIME WASTER.
    When you installed iOS 8 did you read about the new features? Applications can create custom keyboards…
    http://www.imore.com/custom-keyboards-ios-8-explained
    You need to look for an app that has a custom keyboard with the features you require, I suggest you find one without CAPSLOCK
    greghcrash wrote:
    IT IS ALSO AGGRAVATING WHEN TYPING AND IT AUTOMATICALLY CHANGES THE WORDS THAT YOU WANT TO USE.
    THANK YOU FOR YOUR TIME
    Again you need to look at how to manage the device - these settings can be turned off already & you can edit the 'suggestions' too.
    Settings > General > Keyboards > turn Auto-Correction Off.
    Sadly you cannot disable autocorrect temporarily, so it's all or nothing.

  • I occasionally have issues waking my macbook pro up from sleep mode and have to restart the computer. The apple store replaced the sleep part but the problem is still there

    I occasionally have issues waking my macbook pro up from sleep mode resulting in my need to restart the computer. I dislike all of my programs opening at once when I do get the computer started becasue it slows the cpu down. The apple store replaced the sleep part but the problem is still there. Note: i never had this problem with snow leopard

    I'm not certain but my new MBA 13...when in sleep mode comes back on from a black screen when I simply click on the left mouse button. Also, one time I did a SECURE EMPTY TRASH on files that totalled more than 1GB and it took so long that the fan kept increasing in speed so I pressed on the POWER button and the MBA shut...I was able to boot up with no problem. As a rule, I now only do secured erases for trash bin data totalling 500mb or less...anything above that gets a regular erase (dump).

  • [svn:bz-trunk] 21002: Clean up build. xml and remove unnecessary delete task in the jar target.

    Revision: 21002
    Revision: 21002
    Author:   [email protected]
    Date:     2011-03-31 09:47:04 -0700 (Thu, 31 Mar 2011)
    Log Message:
    Clean up build.xml and remove unnecessary delete task in the jar target. 
    Checkin tests passed.
    Modified Paths:
        blazeds/trunk/modules/core/build.xml
        blazeds/trunk/modules/proxy/build.xml
        blazeds/trunk/modules/remoting/build.xml

    Well obviously it is an Ant build.
    It looks to just compile/build a web application into a war so you can deploy it where you want to.
    You don't need to edit it every time you are making a new page. It should work for any generic struts web application laid out in the fashion it expects.
    Cheers,
    evnafets

  • Why does GarageBand reverse my vocal effects the "effected" part of the vocal is sounding as the main recorded part, and vice-versa.

    The "effected" part of the vocal (track echo) is sounding as if it's the main recorded part, and vice-versa. This is happening with every track that's recorded as a real instrument...
    Thanx!

    Among the alternatives not mentioned... Using a TiVo DVR, rather than the X1; a Roamio Plus or Pro would solve both the concern over the quality of the DVR, as well as providing the MoCA bridge capability the poster so desperately wanted the X1 DVR to provide. (Although the TiVo's support only MoCA 1.1.) Just get a third-party MoCA adapter for the distant location. Why the hang-up on having a device provided by Comcast? This seems especially ironic given the opinions expressed regarding payments over time to Comcast. If a MoCA 2.0 bridge was the requirement, they don't exist outside providers. So couldn't the poster have simply requested a replacement XB3 from the local office and configured it down to only providing MoCA bridging -- and perhaps as a wireless access point? Comcast would bill him the monthly rate for the extra device, but such is the state of MoCA 2.0. Much of the OP sounds like frustration over devices providing capabilities the poster *thinks* they should have.

  • I would like to know it it's possible to change the scroll bar from the right part of the firefox browser, to the left part and, if it's possible, how can it be done. Thank you!

    The scroll bar (the one used to scroll up and down any kind of website), that is normally in the right part of the firefox browser, would be of much help to me if it could sometimes be moved to the left part of the browser. Is this possible? How can it be done? Can anybody tell me the exact steps to take in order to do this (if it is possible of course)? This would be helpfull to me, since I think that the firefox scroll bar is overlaping the scroll part of the facebook chat sidebar, since I just can see a few people on this facebook chat sidebar and I can´t scroll along it, as I could a while ago. So my guess is that the firefox scroll bar is covering the other. In order to solve it in a simpler way, I guessed that if the firefox scroll bar could be moved to the left side of the browser, this problem could be solved. So, can anybody help me?

    http://kb.mozillazine.org/layout.scrollbar.side
    Type '''about:config''' in Location (address) bar
    filter for '''layout.scrollbar.side'''
    Right-click the Preference and Modify it to '''3'''
    You may need to reload any pages open to have scrollbar move to left after Preference change.

  • I have a problem with Safari in IOS 8 on my iPad 3. The bookmarks take up a third of the screen and I can't seem to make the bookmarks disappear until I need them. The useful part of the screen is therefore very small. Any suggestions gratefully appr

    I have a problem with Safari in IOS 8 on my iPad 3. The bookmarks take up a third of the screen and I can't seem to make the bookmarks disappear until I need them. The useful part of the screen is therefore very small. Any suggestions gratefully appreciated.

    OK, it now sort of works. A couple of problems here:
    After updating IOS, Safari iCloud was "automatically" switched off
    Switching it on had no effect
    resetting my iPad automatically switched off safari iCloud again
    after switching it back on, it said "turning off safari data"
    switched it off and on again, now it said : "turning on safari data" and the sync worked
    On IOS 7 no problems
    The bookmarks not being displayed was because after pressing the book icon, it defaulted to showing the history and I had to press "Back" to get to the other options

Maybe you are looking for

  • Contacts appearing as phone numbers instead of names...how do i fix this?

    I just updated my 4s software today...as soon as it updated, my previous phone calls and messages are now listed by the person's phone number instead of their name...because I do not know everyone's phone number off the top of my head, this makes mes

  • How do I control pop ups after installation

    I just started a company in Orange City,Fl, we have older windows XP on our computers, i have had latest versions of Adobe installed on all computers, but even after updating to latest versions still recieve messages stating that we need to install l

  • Creation of NewTransaction/Event Key in OBYC - FR5

    Hi wish to create a new Transaction - similar to FR1, in OBYC I have created new trasanction event key @ IMG - MM - Purchasing - Conditions - Define price determination process - Define transaction/event keys Then in OBYC assignd the G/L account as p

  • Problem in customized sub screen field

    Hi all,    Iam facing a problem in dialogue programming.in my customized subscreen, i have three fields. In these three, first two are char and third one is currency. if i enter data on the screen, the third field is not getting the value in debug fo

  • E61 Hanging Updater Software! Is a firmware update...

    E61 1.0610.04.04, 19-04-06 RM-89 CODE 0529664 The Software Updater application hangs at "Starting Application" with the scroll bar spinning. V1.0.88en Is there an update for my phone and how do I resolve the hanging application. St. Louis, MO USA