Removing the data portion

Hi ,
I have a varchar2 field that stores time :
16:29:00
08:30:00...
i want to query this column but after converting it to date and getting only the time portion so i can make some comparisons , but when i issue this query the date part still shows :
select TO_DATE(ACTION_TIME,'HH24:MI:SS')
FROM V$EVENTLOGS;i also tried this select TO_DATE(to_char(ACTION_TIME,'HH24:MI:SS'),'HH24:MI:SS')
FROM V$EVENTLOGS;but it gives:
ERROR at line 1:
ORA-01722: invalid number
Thanks

Hi,
oais wrote:
select TO_DATE(ACTION_TIME,'HH24:MI:SS')
FROM V$EVENTLOGS;i also tried this select TO_DATE(to_char(ACTION_TIME,'HH24:MI:SS'),'HH24:MI:SS')
FROM V$EVENTLOGS;but it gives:
ERROR at line 1:
ORA-01722: invalid numberPerhaps it really means that.
If even one of the strings contains something other than a number (e.g. '??:00:00', you will get that error, and no other results.
To see what rows are not in the correct format, use TRANSLATE.
SELECT  action_time
FROM     v$event_logs     -- as others have said, a confusing name
WHERE     TRANSLATE ( action_time
            , '123456789'
            , '000000000'
            ) != '00:00:00'
;you'll get a different error message if the string contains a valid number that does not happen to be a valid hour, minute or second. You might as well check for those errors at the same time:
SELECT  action_time
FROM     v$event_logs     -- as others have said, a confusing name
WHERE     TRANSLATE ( action_time
            , '123456789'
            , '000000000'
            ) != '00:00:00'
OR     SUBSTR (action_time, 1, 2)     NOT BETWEEN '00' AND '23'
OR     SUBSTR (action_time, 4, 2)     NOT BETWEEN '00' AND '59'
OR     SUBSTR (action_time, 7, 2)     NOT BETWEEN '00' AND '59'
;You should correct (or remove) the invalid strings from the table, then add a CHECK constraint to make sure the data stays clean.
Why are you converting the strings to a DATE?
If you just need to display them, or compare them (e.g., find times between '08:00:00' and '18:00:00') it's better to leave them as strings.
If you do convert them using TO_DATE, note what Justin said:
An Oracle date always has a day component and a time component. If you convert the string '16:29:00' to a date, that automatically becomes today (i.e. 18 April 2009) at 16:29:00.I think Justin made a typo, though. If you don't give a day of the month in TO_DATE, it defaults to the 1st of the month, not the current day.
That is
TO_DATE ( '16:29:00'
        , 'HH24:MI:SS'
        )returns 01-Apr-2009 16:29:40 when run today (April 18) or any time during April 2009.

Similar Messages

  • Would like to remove the data portion from my account. How do i do it?

    would like to remove the data portion from my account. How do i do it?

    Am on NATIONWIDE TALK SHARE 700 with a samsung galaxy 3.
    do not use the data service.
    Thanks for the reply
    On Wed, Jul 16, 2014 at 4:34 PM, 1moretime <[email protected]>

  • I reinstalled my OS and now it wants to empty my phone.  How can I get it to back up my phone without removing the data?

    I reinstalled my OS and now it wants to empty my phone.  How can I get it to back up my phone without removing the data?

    You can't. But if you backed up your computer prior to wiping it out, you should be able to restore your iTunes library, contacts, photos, etc. from that backup. Once you do, you can set the phone up again and just sync everything from your library back to it.
    If you didn't back the computer up either, you can transfer items purchased on the phone into iTunes, and if you set up at least one contact in whatever application you sync your contacts to on the computer, it will offer to merge the address books on the first sync, saving those.  Any media you'd acquired from sources other than the iTunes store will have to be re-downloaded from the source or re-ripped.
    The iPhone is NOT a backup device.

  • Can I remove the date and time from an image taken on my Powershot SX510 HS for printing?

    Natalie1, Once the photo is processed in the camera with the date stamp, it's permanent to the photo. The camera will not have that as a layer to turn off and on at will. It's much easier to add the date/time stamp to a shot for printing then it is to remove it. You will need some editing software such as Photoshop Elements, or Gimp (free), to remove the date/stamp. These software's can do a pretty reasonable job to remove any unwanted elements from the photo. Canon also has their Digital Photo Professional software that comes free with the camera, but it's not as easy to get the nice results of the Photoshop Elements. The change you make with these software's will remove the date/time stamp unless you only mask (layer) it. Steve M.

    Natalie1, Once the photo is processed in the camera with the date stamp, it's permanent to the photo. The camera will not have that as a layer to turn off and on at will. It's much easier to add the date/time stamp to a shot for printing then it is to remove it. You will need some editing software such as Photoshop Elements, or Gimp (free), to remove the date/stamp. These software's can do a pretty reasonable job to remove any unwanted elements from the photo. Canon also has their Digital Photo Professional software that comes free with the camera, but it's not as easy to get the nice results of the Photoshop Elements. The change you make with these software's will remove the date/time stamp unless you only mask (layer) it. Steve M.

  • How do you remove the date/time stamp from a photo before printing?

    I have one group of photos in an event that have the date and time stamp on them.  I don't know how to remove the date/time stamp before printing. 

    If you have your camera set to imprint the date/time on the photo you can not "remove it - it is a part of the photo - depending on the surounding photo you might be able to retouch it out
    LN

  • Removing The Date / "Read More" From My Blog Entries

    I am posting a portfolio site in iWeb and would like to remove the date and "Read More" lines from my blog (video) entries.
    Using the Color and Alignment in Inspector, I tried lowering the opacity on the text so it disappears into the background. It works on my Mac using Safari as my browser. But when I went to a PC and viewed the site in Explorer, the dates and the "read more" were there.
    Please let know if someone can help me with this. Thanks.

    have a look, code is included:
    http://temp.cyclosaurus.com/revolving/Blog/Blog.html

  • Is there a way to remove the date and time from pictures?

    Is there a way to remove the date and time from phoos in iPhoto?

    Are you referring to the Date and Time some cameras put right on the image?  If so there is nothing really good in iPhoto to do this. You could try the Retouch tool and see how that looks but I think you will need something more precise and powerful, like the clone tool in Aperture.
    Also something like PhotoShop or GIMP - The GNU Image Manipulation Program (free) should do what you want also.
    If your asking about some other date post back.
    regards

  • Removing the date and time formatting in Numbers '09

    I'm inputting the number 65-06-19 into a cell and its automatically replaced by a date, if i try to remove the date it puts a time in its place and i want neither.
    I know there must be a simple solution but i can't figure it out ...help!

    Bhenny,
    The simple solution is to Format the entire data range for this item as Text before you start entering data.
    The more difficult one would be to figure out which Date format is causing the problem and eliminate it. I don't recommend that because if it isn't this particular piece of data, it's likely another one sometime in the future will cause a problem with one of the other formats. Better to treat it the simple way.
    Jerry

  • Lost my old iPhone ..... how do i remove the data in other Apple devices?

    My old iPhone (3GS on IOS 4.1 before iCloud was introduced) is lost. It was synchronized using iTunes. I have other devices (iPad, iMac). How do I remove the data created in that iPhone from Calendar, etc. The recurring event created in that old iPhone will continue until I remove them.
    Appreciate the help

    Settings -> General -> Reset -> Erase all Content and Settings
    or restore it to factory settings:
    http://support.apple.com/kb/HT1414
    Regards.

  • Does anyone know how to remove the date stamp from photos?

    I don't remember how I added the date ON the photos to begin with, and now I don't know how to remove them!

    Try the Retouch tool in iPhoto. Otherwise you would need to use a 3rd party image editor, like Photoshop Elements that has a clone or healing tool to remove the date from the image.
    This is what PSE can do but it might be a bit overkill for just doing dates.
    OT

  • [LOG] The data portion of event 18265 from MSSQL$SQLSERVER is invalid

    Hi All,
    I have an instance (SQL SERVER 2008 R2) with 30 databases, all are in full recovery mode.
    While doing the TLOG backup I found following error in the MSSQL AGENT ERROR LOG.
    [LOG] The data portion of event 18265 from MSSQL$SQLSERVER is invalid
    While finding the reason I found that only two small databases are causing this error recording in MSSQL AGENT ERROR LOG. I executed a manul Tlog backup for the identifed databases using TSQL and it shows successful backup (please see below output) but
    agent error log was dumped with the new entries showing the same error (even agent was not used to execute the job).
    Processed 0 pages for database 'XYZ-ae94-41c157aa36a1', file 'XYZ-ae94-41c157aa36a1_log' on file 1.
    BACKUP LOG successfully processed 0 pages in 0.227 seconds (0.000 MB/sec).
    Processed 10 pages for database 'ABC-ccb8c6d4ef00', file 'ABC-ccb8c6d4ef00_log' on file 1.
    BACKUP LOG successfully processed 10 pages in 0.102 seconds (0.727 MB/sec).
    Please assist with your experience for such scanario.
    Best Regards
    khalil

    [LOG] The data portion of event 18265 from MSSQL$SQLSERVER is invalid
    18265 = Log was backed up. Database: %s, creation date(time): %s(%s), first LSN: %s, last LSN: %s, number of dump devices: %d, device information: (%s). This is an informational message only. No user action is required.
    Those lengths are a bit excessive, but certainly within the permitted realms. Are there any other database names that are these long? Are there any special characters in the names?
    Erland's guess is correct. Mostly its due to
    https://support.microsoft.com/kb/2723474
    Balmukund Lakhani
    Please mark solved if I've answered your question, vote for it as helpful to help other users find a solution quicker
    This posting is provided "AS IS" with no warranties, and confers no rights.
    My Blog |
    Team Blog | @Twitter
    | Facebook
    Author: SQL Server 2012 AlwaysOn -
    Paperback, Kindle

  • How to remove the date extensions from a filename in SSIS Flat File Connection Manager dynamically at run time

    Hello,
    I have to load data from a csv file to SQL Database. The file is placed into a directory by another program but the file name being same, has different extensions based on time of the day that it is placed in the directory. Since I know the file name
    ahead of time, so, I want to strip off the date/time extension from the file name so that I can load the file using Flat File Connection Manager. I am trying to use 'variable' and 'expression editor' so that I can specify the file name dynamically. But I
    don't know how to write it correctly. I have a variable 'FileLocation' that holds the folder location where the file will be placed. The file for example:  MyFileName201410231230  (MyFileName always the same, but the date/time will be different)
    Thanks,
    jkrish

    I don't want to use ForEach Loop because the files are placed by a FTP process 3 times a day at a specific time, for ex. at 10 AM, 12 PM and 3 PM. These times are pretty much fixed. The file name is same but the extension will have this day time stamp. I
    have to load each file only once for a particular reason, meaning I don't want to load the ones I already loaded. I am planning on setting up the SSIS process to load at 10:05, 12:05 and 3:05 daily. The files will be piling up in the folder. As it comes,
    I load them. At some point in time, I can remove the old ones so that they won't take up space in the server.  In fact, I don't have to keep the old ones at all since they are saved in a different folder anyways. I can ask the FTP process to
    remove the previous one when the new one arrives. So, at any point in time, there will be one file, but that file will have different extensions every time.
    I am thinking of removing the extensions before I load every time. If the file name is 'MyFileNamexxxxxxx.csv', then I want to change it to 'MyFileName.csv' and load it.
    Thanks,
    jkrish
    You WILL need to use it eventually because you need to iterate over each file.
    Renaming is unnecessary as one way or another you will need to put a processed file away.
    And having the file with the original extension intact will also help you troubleshoot.
    Arthur
    MyBlog
    Twitter

  • How Do You Remove The Date Stamp Setting On The Powershot A590 IS?

    The Date Stamp on our Powershot A590 IS was set by accident, and now we cannot seem to remove it. Anyone know how to change this setting, so that the Date Stamp will not be embedded within our photos (it even seems to be showing up on ALL of our pictures, not just the postcard sized ones . . . but those are our biggest problem, as that's the size we tend to use most)?
    Again, I'm not asking how to remove a Date Stamp from a picture, but how to change the settings so that the Date Stamp isn't applied in the first place. 
    Any help would be appreciated; Thanks!
    -DrSolomonology

    Here is excerpt from the manual (p 22): http://gdlp01.c-wss.com/gds/6/0400000016/01/PSA590IS_CUG_EN.pdf
    1.
    Press the power button.
    2.
    Select a shooting mode.
    1. Set the mode switch to (shooting).
    2. Set the mode dial to .
    • You can also make this setting in other shooting modes
    (except Easy and movie modes).
    Select DATE/STAMP
    Press FUNC/SET button
    Press UP/DOWN or LEFT RIGHT button to change the settings.
    Weekend Travelers Blog | Eastern Sierra Fall Color Guide

  • Layout changes removes the data

    HI,
    We copied a standard program RIAUFK20, the program shows the ALV output . We changed only the fieldcatalog. The problem is when the program shows the output first time it shows the correct data what we added to the standard one. When user changes the layout and the screen refreshes it wipes out the data that we added to the report. How can it be prevented from being removed?
    Thanks in advance

    Sanjane:
    You will also need to modify the layout sets saved for that report; the existing layouts will not take into account your changes to the field catalog & data.
    If using ALV grid (function group SLVC_FULLSCREEN) have a look at function modules REUSE_ALV_GRID_LAYOUT_INFO_GET & REUSE_ALV_GRID_LAYOUT_INFO_SET. If using ALV list (function group SALV) have a look at function modules REUSE_ALV_LIST_LAYOUT_INFO_GET & REUSE_ALV_LIST_LAYOUT_INFO_SET. For all of these function modules, click on "Function Module Documentation" button to see the on-line documentation. You can also find documentation on help.sap.com.
    Regards,
    D.

  • I killed my MBA.  i want to remove the SSD and remove the data.  Is there an adapter for the drive?

    subject pretty much sums it up.
    i need to remove the drive and pull the data from it using another pc.  is there an adapter, usb or otherwise, that fits that drive?
    Is it microsata?
    My mba is late 2011.

    Here is the exact adaper/housing.
    http://eshop.macsales.com/item/OWC/MAU3ENVOY/

Maybe you are looking for

  • Using Get Data From Aggregation event class in SQL Profiler - SSAS 2012

    Hi, I'd like to understand better the use of the Get data from aggregation event class in SQL Profiler to monitor a MDX query and which info provide. Fe, does it return the MDX query? Is it possible to use this event class in order to monitor MDX que

  • Utl_file.file_type / ora01041:hostdef does not exist

    Hello all, I have got a problem with ora01041:hostdef does not exist. My package compiles well untill he reaches a procedure with an declaration with the utl_file. I get above error and Oracle terminates unexpectedly. The stranges thing is that this

  • Address Ctcs Keep getting wiped out

    I am installed Leopard and recently got a .mac subscription. All of my address book contacts keep disappearing. I have already reset all the syncing preferences, but it happens even if nothing is syncing. Address Book is populated for a while, then s

  • IDOC Issue using ALE

    Hi, I am trying to create Invoice using T-code FB60/FBV1. When I save the document should see the entries in NAST table right? but I am not able to find those entries. When I have entry in NAST table only then I can send IDOC to the XI system. When I

  • ORA-00257: archiver error. Connect internal only

    Hello everyone, On 10gR2, if we face the above error, the system would hang for some time. During this time no one will be able to connect. SYSDBA session will hang and wont give you SQL prompt quickly. I want to know if there is any way to remove th