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

Similar Messages

  • 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

  • The time when the PI doc is counted ,I want see the hour and minutes ,

    HI  experts ,
    How can I find when the physical inventory doc had been created ,counted and posted , by hour and minutes ,    the date is not enough .
    Thanks in advance .

    we use MI31 for create Physical inventory doc.
    as a matter of fact ,  what I most want to know is when the count quantity is entered by hour and minutes , because the book quantity in the Physical inventory doc is extract from MBEW table when the count quantity is first entered.After that the book quantity never updated .  So it's necessary to konw the exact time when the count quantity is entered , then we can do the right analysis of physical inventory difference.

  • Strange date format in iPhoto

    When I migrated to Maverick, the date format for all my pictures went batty. For example, the date will show as 43-6-569 or 85-65-741. I tried adjusting the date manually but it doesn't solve the problem. I thought migrating to Yosemite would fix this but the issue has actually spread to itunes. Now the "Date added" column for all the songs also shows this strange format.
    Has anybody seen this issue? Is there a fix?
    Thanks.

    I have it on automatic date setting, using a 24-hour clock. The date format in the Language and Region tab is the typical dd/mm/yy. I double checked every other settings. But I don't think it's a problem with the System Preferences as the date in the manu bar is correct, as is for every other application. The issue is only with iphote and now iTunes.

  • 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.

  • How do you calculate difference in time (hours and minutes) between 2 two date/time fields?

    Have trouble creating formula using FormCalc that will calculate difference in time (hours and minutes) from a Start Date/Time field and End Date/Time field. 
    I am using to automatically calculate total time in hours and minutes only of an equipment outage based on a user entered start date and time and end date and time. 
    For example a user enters start date/time of an equipment outage as 14-Oct-12 08:12 AM and then enters an end date/time of the outage of 15-Oct-12 01:48 PM.  I need a return that automatically calculates total time in hours and minutes of the equipment outage.
    Thanks Chris

    Hi,
    In JavaScript you could do something like;
    var DateTimeRegex = /(\d\d\d\d)-(\d\d)-(\d\d)T(\d\d):(\d\d)/;
    var d1 = DateTimeRegex.exec(DateTimeField1.rawValue);
    if (d1 !== null)
        var fromDate = new Date(d1[1], d1[2]-1, d1[3], d1[4], d1[5]);
    var d2 = DateTimeRegex.exec(DateTimeField2.rawValue);
    if (d2 !== null)
        var toDate = new Date(d2[1], d2[2]-1, d2[3], d2[4], d2[5]);
    const millisecondsPerMinute = 1000 * 60;
    const millisecondsPerHour = millisecondsPerMinute * 60;
    const millisecondsPerDay = millisecondsPerHour * 24;
    var interval = toDate.getTime() - fromDate.getTime();
    var days = Math.floor(interval / millisecondsPerDay );
    interval = interval - (days * millisecondsPerDay );
    var hours = Math.floor(interval / millisecondsPerHour );
    interval = interval - (hours * millisecondsPerHour );
    var minutes = Math.floor(interval / millisecondsPerMinute );
    console.println(days + " days, " + hours + " hours, " + minutes + " minutes");
    This assumes that the values in DateTimeField1 and DateTimeField2 are valid, which means the rawValue will be in a format like 2009-03-15T18:15
    Regards
    Bruce

  • 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

  • Item expiration; by hours or minutes?

    Is it possible to set an item to "expire" in increments of minutes or hours? We have some content here that we'd like to 'cycle' quite often (Ex. school closings) and currently all I'm seeing possible is by days.
    null

    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

  • How can I take minutes from mysql date format

    how can I take minutes from mysql date format??
    example 10:30:00 is stored in my sql and I want to create 3 variables which will store hours, minutes and seconds..
    Cheers..

    "use application date format" is the choice you want.
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.opal-consulting.de/training
    http://apex.oracle.com/pls/otn/f?p=31517:1
    http://www.amazon.de/Oracle-APEX-XE-Praxis/dp/3826655494
    -------------------------------------------------------------------

  • How to sum hours which is varchar2 data type in oracle

    Hi My table is like this
    emp_ngtshthrs (empno number(10),nightshifthrs varchar2(20));
    now I want sum employee nightshifthrs how to do sum of hrs, this is my hours data 01:00,05:00,08:00,10:00,07:00 and 09:00
    I want sum the varchar2 type of hours how to do it? and I want to display even the sum is more than 24:00 hrs

    Well, first you have posted your question in the wrong forum. You should have posted your question in the PL/SQL forum.
    The second problem I see is that you are being too generic when you have your employees enter their night shift hours worked. If you are able, I recommend you modify your table to record hours seperately from minutes and make the columns of type NUMBER instead of type VARCHAR2(). Then you can use simply arithmatic to total the hours and minutes worked.
    If you are locked into your table and can't change it, then you can convert the characters to numbers and then perform your summary arithmatic on the values. For example:
      1  with tab1 as (
      2  select 10 as empno, '01:00' as nightshifthrs from dual union all
      3  select 10 as empno, '05:00' as nightshifthrs from dual union all
      4  select 10 as empno, '08:00' as nightshifthrs from dual union all
      5  select 10 as empno, '10:00' as nightshifthrs from dual union all
      6  select 10 as empno, '07:00' as nightshifthrs from dual union all
      7  select 10 as empno, '09:00' as nightshifthrs from dual)
      8  select sum(to_number(replace(nightshifthrs,':','.'))) AS hours_worked
      9* from tab1
    SQL> /
    HOURS_WORKED
              40
    SQL> Of course, if your users can and do enter minutes, then that complicates the example I provided. You will have to convert the minutes to decimal, sum the amount, then convert the decimal back to time and add this to your hours. For example:
      1  with tab1 as (
      2  select 10 as empno, '01:15' as nightshifthrs from dual union all
      3  select 10 as empno, '05:00' as nightshifthrs from dual union all
      4  select 10 as empno, '08:30' as nightshifthrs from dual union all
      5  select 10 as empno, '10:00' as nightshifthrs from dual union all
      6  select 10 as empno, '07:45' as nightshifthrs from dual union all
      7  select 10 as empno, '09:00' as nightshifthrs from dual)
      8  select sum(to_number(substr(nightshifthrs,1,2))) + SUM(to_number(SUBSTR(nightshifthrs,4,5)))/60
      9* from tab1
    SQL> /
    HOURS_WORKED
            41.5
    SQL> Hope this helps.
    Craig...

  • Numbers of hours in two different dates

    I have two days and it is in df = new SimpleDateFormat("yyyyMMddHHmmss") format.
    start date is 20041203180000 ( year, month, day of month, hours, minutes )
    end date is 20041204050000
    How do I calculate the number of hours between those two days.
    Thanks

    I think this would work (I was bored)...
    public static int getCountBetween(Date d1, Date d2, int field) {
       if(d1 == null || d2 == null) {
          throw new NullPointerException();
       if(d1 == d2 || d1.equals(d2)) {
          return 0;
       if(d1.after(d2)) {
          Date dx = d1;
          d1 = d2;
          d2 = dx;
       Calendar c1 = new GregorianCalendar();
       c1.setTime(d1);
       Calendar c2 = new GregorianCalendar();
       c2.setTime(d2);
       int count = 0;
       while(c1.before(c2)) {
          c1.roll(field, 1);
          count++;
       return count;
    }That's pretty generic,... field would be Calendar.MONTH or Calendar.HOUR_OF_DAY or whatever field. It's probably not as quick as other ways...

  • Change minutes in data type T

    Hi All,
           Is there any FM to convert minutes into time format.
    For example i have 103.8 i.e 103 minutes and 8 seconds and i wanna have as 01:43.80.
    Regards.

    hi,
    could not find any function module....
    here is a very crude logic for this purpose (from a type p variable initially)
    please help yourself in improving this logic in terms of performance.....:-)
    DATA tm1 TYPE p VALUE '103.84' DECIMALS 2.
    DATA : v_frac TYPE p DECIMALS 2 ,
           v_trunc TYPE p DECIMALS 2,
           v_str TYPE string,
           v_int TYPE i,
           v_mod TYPE i,
           v_rem TYPE i,
           v_mod_hrs TYPE i,
           v_rem_hrs TYPE i.
    WRITE :/ 'initial : ', tm1.
    v_trunc = TRUNC( tm1 ).
    v_frac = FRAC( tm1 ).
    v_str = v_frac.
    v_str = v_str+2(2).
    WRITE :/ 'split : ', v_trunc, v_frac.
    v_int = v_str.
    v_mod = v_int / 60.
    v_rem = v_int MOD 60.
    WRITE :/ 'from decimals part : ', v_mod, 'minutes', v_rem, 'seconds'.
    ADD v_mod TO v_trunc.
    WRITE :/ 'new : ', v_trunc, 'minutes', v_rem, 'seconds'.
    v_mod_hrs = FLOOR( v_trunc / 60 ).
    v_rem_hrs = v_trunc  MOD 60.
    WRITE :/ 'final  : ', v_mod_hrs, 'hours', v_rem_hrs, 'minutes', v_rem, 'seconds'.
    rgds,
    PJ

  • How do I convert time from hours and minutes to decimal time

    I am making a spread sheet a work for payroll. I need to make a formula that converts the time from hours and minutes to decimal time. Please help

    Hi Taryn,
    I can't see much from the photo, but I assume your formula is similar to the one I've used below:
    The same formula is used in F4 and F6, and both return the same result (shown in F4).
    F4 was left on "automatic" cell format, and the column widened to accomodate the repeating decimal to the point where Numbers would begin displaying zeros.
    F6 was formatted as shown in the Cell Inspector to show only two decimal places.
    Neither of these is an "exact" decimal, as it is not possible to use a decimal fraction to "exactly" represent 1/6 (or 10/60).
    The likely reasons for yours showing a whole number of hours is a difference between your formula and the one shown in the example here, or a difference in the number of decimal places set in the cell's format.
    Regards,
    Barry
    PS: To take a screen shot:
    Place the mouse pointer at the top left corner of the area you want to nclude in the shot.
    Press shift-command-4.
    Use the mouse to drag a selection rectangle contining the part of the screen you want to include.
    Release the mouse button. (You'll hear the sound of a camera shutter 'snapping' the picture.)
    The screen shot will be saved to your desktop with the name 'screen shot' followed by the date and time.
    The image may be posted to the discussion using the same steps you used to post the photo above.
    B.

  • Hour and minut in table

    Hi!
    I'd like to display hour and minute (HH:mm) in my table, inserted like this Date d = new SimpleDateFormat("HH:mm").parse("14:04");,
    but it displays whole date like "Mon Jul 12 14:04:00 CET 2010". How can I make it to display my format?

    java.util.Date only contains only the number of milliseconds since midnight 1/1/1970 (the epoch). It contains no formatting information so once converted to a Date the format of the original is lost. java.util.Data has a toString() method which prints out in a standard Locale specific format. If you want any other format then use a SimpleDateFormat to create a String representation.
    P.S. I would never use a java.util.Date object to hold a time difference (other than a time relative to the epoch).

  • 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.

Maybe you are looking for

  • Error while converting RTF to PDF

    Hi, I have got a requirement to convert .rtf file to .pdf file while downloading. The .rtf file is in application server. I have used the FM CONVERT_RTF_TO_ITF to convert to ITF format. After this I am using the FM CONVERT_OTF to convert it to pdf fo

  • Imac Intel will not boot up - 3 days old, light on, starts to spin...

    I got an Imac Intel 20" from my husband on mother's day and it now will not turn on!! White light comes on, sounds like it is trying to boot and then nothing... blank screen, no beeps - have unplugged and restarted, tried a million key combination fr

  • 16:10 screens? custom order?

    does anyone know if lenovo does 16:10 screens if the customer pays more? i heard some mention of it but it could be old news. i have to say i hate 16:9 screens offered on practically all pc laptops. there is a good 2inches of wasted space on the lcd

  • Unlock Pin code

    Hi, Was testing out the find myac and it set the (Enter your system lock PIN code to unlock this Mac) now I can't unlock it. Any one have any ideas how I can unlock it.

  • Load multiple Units of Measures using RMDATIND in LSMW

    Hi All,    I have created a conversion for materials using LSMW. I have used the standard direct input    program    RMDATIND.    Requirements have changed considerably over a period of time and now the new one is that I need to     load multiple alt