Getting records where date got hour or minute or seconds

Hi,
I have a date column in database in this format.
yyyy-MM-dd hh24:mi:ss
now I would like to find all the records where it got either hour or minute or second.
Thanks,

SQL> create table test
  2  as
  3  select 1 id, sysdate dt from dual union all
  4  select 2 , trunc (sysdate) from dual
  5  /
Table created.
SQL>
SQL> alter session set nls_date_format = 'dd-mm-yyyy hh24:mi:ss'
  2  /
Session altered.
SQL>
SQL>
SQL> select *
  2    from test
  3  /
        ID DT
         1 26-10-2009 15:50:42
         2 26-10-2009 00:00:00
SQL>
SQL> select *
  2    from test
  3   where trunc (sysdate) <> dt
  4  /
        ID DT
         1 26-10-2009 15:50:42
SQL>
SQL> Edited by: Alex Nuijten on Oct 26, 2009 4:07 PM

Similar Messages

  • Convert "x milliseconds" to "A days B hours C minutes D seconds"

    I'm trying to find an elegant way to convert:
    "X milliseconds" pattern to "A days B hours C minutes D seconds"
    Currently, I use multiplication and division to get the desired result.
    But I was investigating if there's a way to do this using java class?
    Thanks in advance for the help

    What is your definition of a "day" and what other requirements are there? What does this hope to accomplish? If you define a day as 24 hours and couldn't care less about it's corrolation with a calendar then you're not talking about a Date anymore. The best way to accomplish that is probably to use division, which you said is what you're currently doing. If you actually want to calculate when something occurred on a calendar or how many calendar days, weeks, months or years have elapsed since then that's another matter entirely. You might store the time when it started and use that with a Calendar, or you might simply get the current time and subtract the elapsed time to find how long ago that was on a calendar.
    You really needed to give more details, but at this point you've got an answer to just about every possibility.

  • Regarding function module to convert hours to minutes and seconds to minute

    hi all,
        is there any function module to convert hours to minutes and seconds to minutes....if so please guided me....i hav req like this...want to convert all those to minutes[seconds and hours]....

    Hi,
    Use FM
    SD_CALC_DURATION_FROM_DATETIME
    Pass paramters like
    I_DATE1 16.09.2008
    I_TIME1 10:33:00
    I_DATE2 16.09.2008
    I_TIME2 19:00:00
    and you will get the result as below..
    E_TDIFF 8:27
    8 hours and 27 minutes...
    Now u can use this values of hours and minutes to get the exact wage type values... get the details from HR module and multiply it with the hours and minute and calculate it...
    Use Offsets and get the hour and minute value from E_TDIFF
    Hope it will solve your problem..
    Thanks & Regards,
    Naresh

  • Where to see details like minutes and seconds while cutting?

    Hi Guys
    I upgraded to iMovie version 10.0.
    When editing a project, I want to import a fragment and I would like to cut this based on the information my client gave me. They told me to take the part from for instance 0:29:25 until 0:35:25 (hours:minutes:seconds). But I don't see this information anymore?
    How can I see more information and timeline etc.?
    Thanks
    Bob

    No one? :(

  • Find record insert date and time in a table

    Hi All,
    I want to get record insert date and time in a table. There is no datetime column in my table. Are there any possibility to get date and time for each record?
    Thank You

    Thats not easy. If your transaction info still resides on active portion of the log you can use fn_dblog to read out the time at which the transactions occurs. This is useful only if you try it shortly after transaction.
    the code would look like this
    SELECT *
    FROM fn_dblog(null,null)
    WHERE [Transaction Name] LIKE 'INSERT%'
    OR [Transaction Name] LIKE 'UPDATE%'
    Also see
    http://www.mssqltips.com/sqlservertip/3076/how-to-read-the-sql-server-database-transaction-log/
    http://solutioncenter.apexsql.com/read-a-sql-server-transaction-log/
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • 60-minute recorded program stops at the 49-minute mark

    On Tuesday, our DVR (QIP2708)- recorded a regularly-scheduled show from 8:00 to 9:00. In the DVR's recorded programs, it showed as 59 minutes, 45 seconds (roughly). Watched the show until about the 49-minute mark, but the recording stopped abruptly and returned to the DVR menu. Hitting "resume playback" results in the last 2-3 seconds playing, then it just returns to the menu.
    I tried fast-forwarding and skipping to the end, with no positive result. Once it gets to this 49-minute mark, it just stops, even though the progress bar shows a 59-minute recording. I manually reset the STB with no luck. Even tried watching on a remote STB but the result was the same. There's no error message displayed; the recording just stops.
    It seems, just before the issue happens at the 49-minute mark, that the recorded program starts "skipping frames". I'd almost say that the video frames are "out of sync".
    We had no power outage on Tuesday, and as far as I know, everything "FiOS" was working fine, as we were watching another program at the time this recording was taking place and we're constantly using a PC someplace in the house. I'm suspecting the recorded file is just corrupt, but I'm wondering if anybody else has seen this problem....?
    I can go back and finish watching the show via the broadcast network's online library, but feel I shouldn't have to do that. I'm also wondering if this is indicative of a hard-drive problem in the DVR. (Certainly, if it appears more often, I'll request a replacement.)
    Any insight greatly appreciated. Thanks!

    Now is this the only program where you've experienced this issue? Can you test a few other programs and see if you get similar results?If the problem is on-going, then yes we can easily ship you out a replacement DVR. It's possible the channel had an outage and went off the air for a short bit aswell so could be a freak occurance.

  • GregorianCalendar - getting the current date

    Hi,
    Have any of the Calendar classes been changed in version 1.5. I'm trying to get the current date and time in an application, to add to filenames when they are backed up. In java 1.4 the following code was sufficient to get the information required:
    GregorianCalendar cal = new GregorianCalendar();
    filename = "C:\\Program Files\\Apache Group\\Apache2\\www\\test\\htdocs\\backups\\";
    filename += theFile;
    filename += "=" + getUser() + "=" + cal.get( Calendar.HOUR_OF_DAY ) + "_" +
         cal.get( Calendar.MINUTE ) + "=" + cal.get( Calendar.DAY_OF_MONTH ) + "_" +
         ( cal.get( Calendar.MONTH ) + 1 ) + "_" + cal.get( Calendar.YEAR );
    I'm writing another app using the same code and SDK 1.5, but it's returning the same values every time.
    Cheers
    Matt

    I wrote a small program to test the Calendar object on my system:
    import java.util.*;
    import java.awt.event.*;
    import java.awt.*;
    public class Tester extends Frame implements ActionListener
         public Tester()
              javax.swing.Timer timer = new javax.swing.Timer( 1000, this );
              timer.start();
              setSize( 400, 400 );
              show();
              addWindowListener(
                   new WindowAdapter()
                        public void windowClosing( WindowEvent e )
                             System.exit( 0 );
         public void actionPerformed( ActionEvent e )
              Calendar cal = new GregorianCalendar();
              System.out.println( "Time: " + cal.HOUR + ":" + cal.MINUTE + ":" + cal.SECOND );
         public static void main( String args[] )
              Tester t = new Tester();
    This repeatedly outputs:
    10:12:13
    I tried this with Calendar and GregorianCalendar. Both of them do not seem to work. I'm not using the same Calendar object, or outputing in the same second....

  • I just got iphone 5c and i am not happy with it. It uses to much data and i don't even know how. I can't get the ringtones i want for my contacts.I got it on my free upgrade but i want to take it back and get something else but where i got it they say i c

    I just got iphone 5c and i am not happy with it. It uses to much data and i don't even know how. I can't get the ringtones i want for my contacts.I got it on my free upgrade but i want to take it back and get something else but where i got it they say i can't because i don't have the earbuds and i have serches or them. now i am suck with a phone i don't like at all until my next upgrade. this is very dishearten

    1. If you are this unhappy with that phone, and the lost earbuds is the only thing stopping you from taking it back, why do not just buy some earbuds. That way you can get rid of that phone. It all depend upon how much you want to get rid of that phone.
    2. Yet if you are stuck with that iPhone, here is something might help you to control the data usage. By design, iPhones do turn off WiFi when they go dormant. So if a download is in progress and so forth when the phone goes dormant, it will switch to use cellular data, if this setting is left on. Therefore, from multi-sources I have learned that if you keep your iPhone connected to a power source, then it will stay connected to the available WiFi.

  • How can I get max, min & average (hours with minutes) of fast 30 days data

    Table name:
    run_log
    TYPE VARCHAR2(10),
    SUBTYPE VARCHAR2(10),
    PROGRAM VARCHAR2(100),
    STATUS VARCHAR2(20),
    START_TIME      DATE,
    END_TIME      DATE
    How can I get max, min & average (hours with minutes) of fast 30 days data ?

    Hi,
    you have to use analytical functions:
    SELECT start_day,
           round(AVG(daily_avg)
                 over(ORDER BY start_day ASC RANGE BETWEEN INTERVAL '30' DAY preceding AND INTERVAL '0' DAY following)) AS moving_avg,
           round(MAX(daily_max)
                 over(ORDER BY start_day ASC RANGE BETWEEN INTERVAL '30' DAY preceding AND INTERVAL '0' DAY following)) AS moving_max,
           round(MIN(daily_min)
                 over(ORDER BY start_day ASC RANGE BETWEEN INTERVAL '30' DAY preceding AND INTERVAL '0' DAY following)) AS moving_min
      FROM (SELECT trunc(t.start_time) start_day,
                   AVG((t.end_time - t.start_time) * 24 * 60 * 60) AS daily_avg,
                   MAX((t.end_time - t.start_time) * 24 * 60 * 60) AS daily_max,
                   MIN((t.end_time - t.start_time) * 24 * 60 * 60) AS daily_min
              FROM run_log
             GROUP BY trunc(t.start_time)) t
    ORDER BY 1 DESCAnalytical functions are described in the Oracle doc "Data Warehousing Guide".
    Regards,
    Carsten.

  • Since yesterday, clicking to read my email gets a blank window, not the email. Same w/ windows where data should be entered (like with online banking). Help!

    Since yesterday, when I click to read my email I get a blank window instead of the usual window with the email itself. The same is happening with windows where data should be entered, like those virtual keyboards for online banking login, or windows where you can add records (like daily electricity and gas consumption). In all these situations, a window should pop-up and pop-up it does - but always blank.
    I already unistalled/reinstalled Firefox and reset it "to its default state".
    Thanks in advance for your help.
    Miguel Sendim

    Hello,
    Many site issues can be caused by corrupt cookies or cache. In order to try to fix these problems, the first step is to clear both cookies and the cache.
    Note: ''This will temporarily log you out of all sites you're logged in to.''
    To clear cache and cookies do the following:
    #Go to Firefox > History > Clear recent history or (if no Firefox button is shown) go to Tools > Clear recent history.
    #Under "Time range to clear", select "Everything".
    #Now, click the arrow next to Details to toggle the Details list active.
    #From the details list, check ''Cache'' and ''Cookies'' and uncheck everything else.
    #Now click the ''Clear now'' button.
    Further information can be found in the [[Clear your cache, history and other personal information in Firefox]] article.
    Did this fix your problems? Please report back to us!
    Thank you.

  • I synced my iPad touch with my Mac and all my music is gone. The original computer where I loaded hours and hours of music is gone how can I get my music back?

    I Synced my iPod toichabod with my MacBook pro and all my music is gone!!  The original computer where I loaded hours and hours of musixnis no more. Help?!!!

    You can redownload most iTunes purchases by:        
    Downloading past purchases from the App Store, iBookstore, and iTunes Store         
    For other music yo will have to get them from you you got them before.

  • Forms6i - Search by hours, or minutes in Date Format.

    Hi All:
    Is it possible to search by hours,minutes, or seconds in the date format? I've tried the below SQL but it doesn't work.
    SELECT to_char(start_date, 'MM/DD/YY HH24:MI:SS') start_date
    FROM table_name
    WHERE start_date like '%05%';
    It returns no rows selected instead of the following rows.
    09/11/02 05:27:33
    09/11/02 05:27:35
    Please help.
    Thanks in advance,
    Regards,
    TD

    Hi,
    Change the WHERE clause,
    Where To_Char(start_date, 'DD-MM-YYYY hh24:mi:ss') Like '%05%'
    Ta
    Shailender
    Hi All:
    Is it possible to search by hours,minutes, or seconds in the date format? I've tried the below SQL but it doesn't work.
    SELECT to_char(start_date, 'MM/DD/YY HH24:MI:SS') start_date
    FROM table_name
    WHERE start_date like '%05%';
    It returns no rows selected instead of the following rows.
    09/11/02 05:27:33
    09/11/02 05:27:35
    Please help.
    Thanks in advance,
    Regards,
    TD

  • [Solved] get records with a date of 11/6/2007 I have to add -1 [Solved]

    Hello - really simple question here, I think anyway.
    I have this line in my query -
    WHERE table2.trans_date_time BETWEEN :p_from_date -1 AND :p_to_date + 1
    Notice the -1 + 1, I had to put this in there because if I wanted all the records that have a date of 11/6/2007, and I enter 11/6/2007 and 11/6/2007 for the variables I get nothing back. But when I added the -1 + 1 it worked.
    Why is this? The table2.trans_date_time column is a DATE data type.
    Thanks!
    Message was edited by:
    computerGal

    Hello compterGal
    I agree with Boneist. What more your where clause statement example, will actually will return all records where the trans_date_time is between 10/06/2007 00:00 and 12/06/2007 00:00 inclusive. That is 2 days and 1 second's worth of data.
    A possible solution if you're looking just for records on a specific day in this senario, but also allow date range capabilities then the following where clause example would be suitable:
    WHERE trunc(table2.trans_date_time) BETWEEN :p_from_date AND :p_to_date
    If the query runs slowly and you have an 8i or later database you can use function indexing to help spead the query up.
    hope this helps.
    Cheers
    Q

  • I have an attachment to my iPod Classic that allows me to record. However, when the hard drive died on my last computer I lost the software that allowed me to transfer files for burning CD's or email, etc. I don't remember where I got the software and the

    I have an attachment to my iPod Classic that allows me to record. However, when the hard drive died on my last computer I lost the software that allowed me to transfer files for burning CD's or email, etc. I don't remember have an attachment to my iPod Classic that allows me to record. However, when the hard drive died on my last computer I lost the software that allowed me to transfer files for burning CD's or email, etc. I don't remember where I got the software and the package with the instructions is long gone. Anyone know where to get it?

    What is the make and model of this recorder?  Do you have that information available?
    You can still use iTunes to transfer and manage your recorded audio.
    iPod: Recording voice memos
    B-rock

  • Add hours and minutes to date

    Hi,
    I need to write a function which has two input parameters.
    Parameter1 => Date data type, value is in GMT.
    Parameter1 => String value which indicates the time offset and it has the following format.
    GMT(sign)HH24Mi
    for examples:
    GMT+400 , GMT-1400
    I need add the offset (param2) to the date (param1) and returns as the output.
    I wrote a simple code but can't get it to work. I would like to know if there is an another way to do it.
    create or replace
    Function         F_FUNCTION_NAME(dt date,timeZoneOffset   in   varchar2)
    return date
    As
        offset  varchar2(9);   
    Begin
        Offset := (To_Char(Substr(Substr(Timezoneoffset,4),0,Length(Substr(Timezoneoffset,4))-2)||':'||Substr(Substr(Timezoneoffset,4),-2)));
        return Dt + interval Offset hour to minute;
    End;Thank You.

    Hi Sajeeva,
    this will work with your input, however GMT can range only from GMT-1200 to GMT+1400. Values out of this range will not work.
    ALTER SESSION SET NLS_DATE_FORMAT = 'DD/MM/YYYY HH24:MI:SS';
    CREATE OR REPLACE FUNCTION f_function_name (dt DATE
    , timezoneoffset IN VARCHAR2               )
       RETURN DATE
    AS
       offset  VARCHAR2 (9) := REGEXP_REPLACE (timezoneoffset, 'GMT(\+|-)([0-9]{1,2})([0-9]{2})', '\1\2:\3');
    BEGIN
       RETURN CAST (FROM_TZ (CAST (dt AS TIMESTAMP), 'GMT') AT TIME ZONE offset AS DATE);
    EXCEPTION
       WHEN OTHERS
       THEN
          RETURN NULL;
    END;
    SELECT f_function_name (TO_DATE ('06/03/2013 12:45:00', 'DD/MM/YYYY/ HH24:MI:SS'), 'GMT+400') newdt
      FROM DUAL;
    NEWDT               
    06/03/2013 16:45:00 
    1 row selected.
    SELECT f_function_name (TO_DATE ('06/03/2013 12:45:00', 'DD/MM/YYYY/ HH24:MI:SS'), 'GMT+1400') newdt
      FROM DUAL;
    NEWDT               
    07/03/2013 02:45:00 
    1 row selected.
    SELECT f_function_name (TO_DATE ('06/03/2013 12:45:00', 'DD/MM/YYYY/ HH24:MI:SS'), 'GMT-1200') newdt
      FROM DUAL;
    NEWDT               
    06/03/2013 00:45:00 
    1 row selected.
    -- This will not work 
    SELECT f_function_name (TO_DATE ('06/03/2013 12:45:00', 'DD/MM/YYYY/ HH24:MI:SS'), 'GMT-1400') newdt
      FROM DUAL;
    NEWDT               
    1 row selected.The problem on the last row is related to Oracle not accepting the time zone and throwing this error:
    SELECT SYSTIMESTAMP AT TIME ZONE '-13:00' FROM DUAL;
    ORA-01874: time zone hour must be between -12 and 14Regards.
    Al
    Edited by: Alberto Faenza on Mar 6, 2013 12:57 PM

Maybe you are looking for