To_date(to_char(sysdate,'dd/mm/yyyy hh24:mm'),'dd/mm/yyyy hh24:mm')

Hi
I am using this conversion to_date(to_char(sysdate,'dd/mm/yyyy hh24:mm'),'dd/mm/yyyy hh24:mm')
but it says format string appears twice
Could some one please help me with this?

user11365275 wrote:
I have a requirement for taking hh:mi from a date ..ie i need to compare two dates till hrs and mins level but not secs..so i was trying to take the date till hrs,mins and then convert to dates and compare them...Exactly this is my requirement
to_date(TO_CHAR(LOAD_DATE,'DD/MM/YYYY HH24:Mi'),'DD/MM/YYYY HH24:Mi')
<(SELECT to_date(TO_CHAR(CURRLOADTIME,'DD/MM/YYYY HH24:Mi'),'DD/MM/YYYY HH24:Mi')
FROM Table1 WHERE
JOBNAME='DEFAULT_EVENT_LOG');
PLease can you suggest anything better than this comparison or let me know if this works correct nowYou are using a TO_CHAR to format a date field in a string. Then use a TO_DATE to change it back to a date. This "double" formatting is a deep misunderstanding about what is a date field.
If you want to compare dates and get rid of the seconds, use truncate, for instance :
SQL> select trunc(sysdate,'mi'),sysdate from dual;
TRUNC(SYSDATE,'MI') SYSDATE
02/02/2010 09:18:00 02/02/2010 09:18:55Your WHERE clause will become :
...trunc(LOAD_DATE,'mi')<(SELECT trunc(CURRLOADTIME,'mi')...Nicolas.

Similar Messages

  • TO_DATE(TO_CHAR(sysdate, 'MM/DD/YYYY'), 'MM/DD/YYYY')

    Hi all,
    I am working with a Oracle 9i R2 database
    SQL>select TO_CHAR(sysdate, 'MM/DD/YYYY') CHRDATE from dual;
    CHRDATE
    11/14/2005
    SQL>select TO_DATE(TO_CHAR(sysdate, 'MM/DD/YYYY'), 'MM/DD/YYYY') mydate from dual;
    MYDATE
    14-NOV-05
    I want to retain the 4 digit year. Please suggest what I am doing incorrect.
    Thanks

    Your select statement,SQL>select TO_DATE(TO_CHAR(sysdate,...is equivalent toselect sysdate...And whenever you select a date, SQL Plus has to convert it to a character format before it can display it on the SQL Plus output screen.
    The four-digit year IS being retained internally ...until you display it on the screen. If you just set the default date format for displaying dates to include the four-digit year, you will see the full year:
    SQL> select SYSDATE mydate from dual;
    MYDATE
    14-NOV-05
    SQL> alter session set nls_date_format = 'MM/DD/YYYY';
    SQL> select SYSDATE mydate from dual;
    MYDATE
    11/14/2005
    SQL> select TO_DATE(TO_CHAR(sysdate, 'MM/DD/YYYY'), 'MM/DD/YYYY') mydate from dual;
    MYDATE
    11/14/2005

  • Difference between storing sysdate and to_date(to_char(sysdate, 'DD Mon YYY

    What is the difference between storing sysdate or to_date(to_char(sysdate, 'DD Mon YYYY HH:MI AM'),'DD Mon YYYY HH:MI AM') in a date data type column?
    When I column value is set with sysdate the following query gives no records
    select *
    from Test
    WHERE Updatedon = to_date('22 Sep 2012 07:55 PM','DD Mon YYYY HH:MI AM');
    when I run the same query with out where clause I am getting the records with that time or storing with to_date(to_char(sysdate, 'DD Mon YYYY HH:MI AM'),'DD Mon YYYY HH:MI AM') gives records.
    Can someone explain the difference please?

    Hi,
    Welcome to the forum!
    user8765044 wrote:
    What is the difference between storing sysdate or to_date(to_char(sysdate, 'DD Mon YYYY HH:MI AM'),'DD Mon YYYY HH:MI AM') in a date data type column?Remember that all DATEs include hours, minutes and seconds , as well as year, month and day.
    to_date(to_char(sysdate, 'DD Mon YYYY HH:MI AM'),'DD Mon YYYY HH:MI AM')is equivalent to
    TRUNC (SYSDATE, 'MI')To see why, consider what
    to_char(sysdate, 'DD Mon YYYY HH:MI AM'),does. It creates a string out of the year, month, day, hours and minutes of SYSDATE, but it ignores the seconds. If you convert that string into a DATE, the seconds will default to 00.
    When I column value is set with sysdate the following query gives no records
    select *
    from Test
    WHERE Updatedon = to_date('22 Sep 2012 07:55 PM','DD Mon YYYY HH:MI AM');
    when I run the same query with out where clause I am getting the records with that time or storing with to_date(to_char(sysdate, 'DD Mon YYYY HH:MI AM'),'DD Mon YYYY HH:MI AM') gives records.Whenever you get confusing results with DATEs, display the full DATE, including hours, minutes and seconds.
    To change the default DATE format in your session, so that the hours, minutes and seconds appear automatically, use ALTER SESSION. For example:
    ALTER SESSION  SET NLS_DATE_FORMAT = 'DD-Mon-YYYY HH:MI:SS AM';

  • How can I remove blank space after month value while selecting to_char(sysdate)

    select to_char(sysdate,'dd-month-yyyy') from dual;
    when I give this query, I'm getting a blank space after the month value. How can I trim that?

    Or else try this one
    select to_char(sysdate,'dd-fmmonth-yyyy') from dual;
    Best of luck.

  • To_char(adate,'dd.mm.yyyy')   returns different results  from  two oracle clients !!! Is it  possible?

    Dear all;
    We have only one Database server with some IIS's   as web servers on front . Each web server has own oracle client software in order connect to central database..
    The same following query used in C#  code  returns different results on each IIS server.(3 row, or  not data found )
    why?
    select     *    from    aTable    where        to_char( adate ,  'dd.mm.yyyy' )  =   :search_date
    regards
    Siya

    1006237 wrote:
    If adate is of DATE datatype, it will most likely has the time component. Therefore your SQL below is unlikely to return any data.
    select * from aTable where adate = to_date(:search_date, 'dd.mm.yyyy')
    Perhaps.....
    select * from aTable where TRUNC(adate) = to_date(:search_date, 'dd.mm.yyyy')
    Hi,
    not having any sample data from you I could not understand that you wanted to select the range 00:00:00 - 23:59:59 on search_date.
    Your method might not be efficient if you have an index on adate.
    Maybe something like this will be more efficient
    select * from aTable
    where adate >= to_date(:search_date, 'dd.mm.yyyy')
      and adate <  to_date(:search_date, 'dd.mm.yyyy') + 1;
    If you search_date is 30-Aug-2013 it will get records where adate >= 30-Aug-2013 00:00:00 and adate < 31-Aug-2013 00:00:00, so any time of date 30-Aug-2013.
    Try like this and let us know if you still have 2 different results.
    Regards.
    Alberto

  • SELECT to_char(CURRENT_TIMESTAMP,'DD-MM-RRRR HH24:MI:SS') from dual

    Hi,
    I have a field with timestamp(6) and trying to write substitution variable for it using
         SELECT to_char(CURRENT_TIMESTAMP,'DD-MM-RRRR HH24:MI:SS') from dual
    sql works fine in sql workshop but not when i code it behind page im geting below error
    ORA-20505: Error in DML: p_rowid=5000005472, p_alt_rowid=CUS_ID, p_rowid2=1, p_alt_rowid2=CLO_ID. ORA-01830: date format picture ends before converting entire input string ORA-02063: preceding line from DBTEST_CDB
         Error     Unable to process row of table CDB_CNRCLV04
    i tried select sysdate from dual
    it worked fine but doesnt set time, time is set to 12:00:00 by default.
    can someone advice please
    Thanks

    currently selecting from table values for timestamp field arel ike
    02-NOV-07 11.23.45.550469
    07-JUL-07 09.02.42.730587
    07-JUL-07 09.02.42.730763
    07-JUL-07 09.02.42.730933
    07-JUL-07 09.02.42.731121
    02-NOV-07 11.24.00.077148
    10-AUG-07 17.24.28.325245
    20-MAY-08 00.00.00.000000
    23-MAY-08 16.00.00.000000
    thank you

  • To_date,to_char function behavior

    I have a table that contains starting dates of employment for employees. Since the table could have several starting dates (This is normal in our institution), I wrote a pl/sql loop to count the number of employees whose ONLY starting date (meaning they have only one starting date) lies in the year 2008. Now I faced the following problems when running the code in a when-button-pressed trigger in forms:
    1. the counter in the statement
    if to_char(docexecdt,'dd-mm-yyyy) between '1-1-2008' and '31-12-2008' then x:=x+1
    returned an abnormal number (too large for the size of the table)
    (where docexecdt is the field containing the starting date)
    is using to_char here incorrect?
    2. the statement
    if to_date(docexecdt) between '1-1-2008' and '31-12-2008' then x:=x+1
    returned an error "invalid month"
    although I tried several date formats.
    given that I tried running the same to_date function on the table in sql*plus with no error returned.
    What is the correct format mask for the to_date function?

    -> Why does the to_char(docexecdt,'dd-mm-yyyy') return an incorrect result?
    Because putting dd (the day of the month) first puts EVERY day between your dates:
    01-01-2008 is LESS than ALL the following dates:
    01-02-1982
    12-01-2000
    15-08-1998
    30-01-2009
    30-12-2020
    31-12-2008 is GREATER than ALL the above dates.
    NEVER compare dates by placing DAY or MONTH before the year!!!!
    When you compare using DDMMYYYY format, the only dates less than 01-01-2008 are January 1 of any prior year. The only dates greater than 31-12-2008 are 31-December of any year greater than 2008.
    The correct way to find your count is given by Paul M, where you ONLY look at the year.

  • What is the use of To_date, to_char functions?

    what is the use of To_date, to_char functions?
    while i am using these in my day to day activities but never able to know the exact working of tehse.
    Message was edited by:
    437022

    Dates are stored and manipulated as coded (binary) values that always contain "century, year, month, date, hour, minute second"
    We don't want to see the date as stored. We want to see the characters (digits) that make up the date. So we use to_char(the-date-value)
    We want to tell the system a date, but have a heck of a time entering the binary. So we input the characters (digits) that make up the date and tell the system to convert that to a binary 'date' using to_date(our-string-that-respresents-dates)
    The magic Oracle has added is the format codes (see chapter 2 of the SQL Reference manual for the complete list). We can get the system to print out dates and times, including day of week (and so on) using format codes.
    The default format is to show us the date but not the time. Which leads a lot of people to believe that the time is not stored.

  • Max(to_char(date,'DD-MM-YYYY')) ?

    Hi All,
    SQL> desc hday;
    Name Null? Type
    H_DATE NOT NULL DATE
    SQL> select max(h_date) from hday;
    MAX(H_DATE
    03-JAN-11
    SQL> select max(to_char(h_date,'DD-MM-YY')) from hday;
    MAX(TO_C
    31-12-99
    SQL> select max(to_char(h_date,'DD-MON-YY')) from hday;
    MAX(TO_CH
    31-MAY-99
    My question is why am i getting different dates when i use different date formats in MAX function ?
    any ideas ?
    greddy

    Always compare dates in date format. don't use to_char and then a function on top of it. Use the function on the date type. Also, check this out:
    SQL> create table hday(h_date date);
    Table created.
    SQL> insert into hday values('03-JAN-11');
    1 row created.
    SQL> insert into hday values('31-MAY-99');
    1 row created.
    SQL> insert into hday values('31-DEC-99');
    1 row created.
    SQL> SELECT * FROM HDAY;
    H_DATE
    03-JAN-11
    31-MAY-99
    31-DEC-99
    SQL>  SELECT TO_CHAR(H_DATE, 'DD-MON-YYYY')
      2   FROM HDAY;
    TO_CHAR(H_D
    03-JAN-2011
    31-MAY-1999
    31-DEC-1999
    SQL> SELECT TO_CHAR(H_DATE, 'DD-MON-RRRR')
      2  FROM HDAY;
    TO_CHAR(H_D
    03-JAN-2011
    31-MAY-1999
    31-DEC-1999
    SQL> select max(h_date)
      2  from hday;
    MAX(H_DAT
    03-JAN-11Now this makes a little more sense! In sumary, after y2k oracle recognizes any year before 1950 to be of the 2000's and any year after 1950 to be of the 1900's. For example, 00 is 2000 and not 1900. Also, 51 is 1951 and not 2051. To give you the exact terminology and logic behind I would have to look in the documentation. To avoid this problem, user four digit year when working with dates.
    SQL> insert into hday values('03-JAN-1911');
    1 row created.
    SQL> SELECT TO_CHAR(H_DATE, 'DD-MON-YYYY')
      2  FROM HDAY;
    TO_CHAR(H_D
    03-JAN-2011
    31-MAY-1999
    31-DEC-1999
    03-JAN-1911
    SQL> select to_char(min(h_date), 'dd-mon-yyyy') dt
      2  from hday
      3  union
      4  select to_char(max(h_date), 'dd-mon-yyyy') dt
      5  from hday;
    DT
    03-jan-1911
    03-jan-2011

  • TO_CHAR(hire_date,'fmDD MONTH YYYY') TO_CHAR(hire_date,'DD MONTH YYYY')

    Given following 2 querys on sample table employees.
    Both return diffrent row. But can't identify on what gorud it is working. as both the column look exactly same in list.
    TO_CHAR(hire_date,'fmDD MONTH YYYY') <> TO_CHAR(hire_date,'DD MONTH YYYY')
    (1st Query)
    SELECT employee_id, hire_date,TO_CHAR(hire_date,'fmDD MONTH YYYY') Month_Hireed,TO_CHAR(hire_date,'DD MONTH YYYY')
    FROM employees
    WHERE TO_CHAR(hire_date,'fmDD MONTH YYYY') <> TO_CHAR(hire_date,'DD MONTH YYYY');
    (2ndt Query)
    SELECT employee_id, hire_date,TO_CHAR(hire_date,'fmDD MONTH YYYY') Month_Hireed,TO_CHAR(hire_date,'DD MONTH YYYY')
    FROM employees
    WHERE TO_CHAR(hire_date,'fmDD MONTH YYYY') = TO_CHAR(hire_date,'DD MONTH YYYY');
    Chk result of query 1).
    One can easily figure out difference between 5 & 05. But what is difference between 15 & 15 ?
    Seems apart from September Month everything fall under != NOT EQUAL to sings.
    1)
    SQL*Plus ReportSELECT hire_date AS "DATE", TO_CHAR(hire_date,'fmDD MONTH RRRR')
    AS "A", TO_CHAR(hire_date,'DD MONTH RRRR') AS "B"
    FROM employees
    WHERE TO_CHAR(hire_date,'fmDD MONTH RRRR') != TO_CHAR(hire_date,'DD MONTH
    RRRR');
    DATE------------------------------ A--------------------------------------- B
    17-JUN-87...........17 JUNE 1987...................17 JUNE 1987
    13-JAN-93...........13 JANUARY 1993............13 JANUARY 1993
    03-JAN-90.............3 JANUARY 1990............03 JANUARY 1990
    21-MAY-91......... 21 MAY 1991....................21 MAY 1991
    25-JUN-97.......... 25 JUNE 1997...................25 JUNE 1997
    05-FEB-98........... 5 FEBRUARY 1998......... 05 FEBRUARY 1998
    07-FEB-99........... 7 FEBRUARY 1999......... 07 FEBRUARY 1999
    2)
    SQL*Plus ReportSELECT hire_date AS "DATE", TO_CHAR(hire_date,'fmDD MONTH RRRR')
    AS "A", TO_CHAR(hire_date,'DD MONTH RRRR') AS "B"
    FROM employees
    WHERE TO_CHAR(hire_date,'fmDD MONTH RRRR') = TO_CHAR(hire_date,'DD MONTH RRRR');
    DATE------------------------------ A----------------------------------------------- B
    21-SEP-89...........21 SEPTEMBER 1989...........21 SEPTEMBER 1989
    28-SEP-97...........28 SEPTEMBER 1997...........28 SEPTEMBER 1997
    30-SEP-97...........30 SEPTEMBER 1997...........30 SEPTEMBER 1997
    28-SEP-98...........28 SEPTEMBER 1998...........28 SEPTEMBER 1998
    17-SEP-87...........17 SEPTEMBER 1987...........17 SEPTEMBER 1987
    [….. are add to increase readability as cant post in html format here]
    Message was edited by:
    user554589

    Chk result of query 1).
    One can easily figure out difference between 5 & 05. But what is difference between 15 & 15 ?
    Seems apart from September Month everything fall under != NOT EQUAL to sings.
    1)
    SQL*Plus ReportSELECT hire_date AS "DATE", TO_CHAR(hire_date,'fmDD MONTH RRRR')
    AS "A", TO_CHAR(hire_date,'DD MONTH RRRR') AS "B"
    FROM employees
    WHERE TO_CHAR(hire_date,'fmDD MONTH RRRR') != TO_CHAR(hire_date,'DD MONTH
    RRRR');
    DATE------------------------------ A--------------------------------------- B
    17-JUN-87...........17 JUNE 1987...................17 JUNE 1987
    13-JAN-93...........13 JANUARY 1993............13 JANUARY 1993
    03-JAN-90.............3 JANUARY 1990............03 JANUARY 1990
    21-MAY-91......... 21 MAY 1991....................21 MAY 1991
    25-JUN-97.......... 25 JUNE 1997...................25 JUNE 1997
    05-FEB-98........... 5 FEBRUARY 1998......... 05 FEBRUARY 1998
    07-FEB-99........... 7 FEBRUARY 1999......... 07 FEBRUARY 1999
    2)
    SQL*Plus ReportSELECT hire_date AS "DATE", TO_CHAR(hire_date,'fmDD MONTH RRRR')
    AS "A", TO_CHAR(hire_date,'DD MONTH RRRR') AS "B"
    FROM employees
    WHERE TO_CHAR(hire_date,'fmDD MONTH RRRR') = TO_CHAR(hire_date,'DD MONTH RRRR');
    DATE------------------------------ A----------------------------------------------- B
    21-SEP-89...........21 SEPTEMBER 1989...........21 SEPTEMBER 1989
    28-SEP-97...........28 SEPTEMBER 1997...........28 SEPTEMBER 1997
    30-SEP-97...........30 SEPTEMBER 1997...........30 SEPTEMBER 1997
    28-SEP-98...........28 SEPTEMBER 1998...........28 SEPTEMBER 1998
    17-SEP-87...........17 SEPTEMBER 1987...........17 SEPTEMBER 1987
    [….. are add to increase readability as cant post in html format here]

  • Usage of to_date & to_char

    pls. give advanced usage of to_date & to_char

    pls. give advanced usage of to_date & to_charTO_DATE
    http://download-uk.oracle.com/docs/cd/B10501_01/server.920/a96540/functions137a.htm
    TO_CHAR
    http://download-uk.oracle.com/docs/cd/B10501_01/server.920/a96540/functions134a.htm#1009326
    http://download-uk.oracle.com/docs/cd/B10501_01/server.920/a96540/functions133a.htm#1003490
    http://download-uk.oracle.com/docs/cd/B10501_01/server.920/a96540/functions135a.htm#79332

  • Sysdate from oracle db in mm/dd/yyyy hh24:mi:ss format

    I am trying to get sysdate from oracle db in mm/dd/yyyy hh24:mi:ss format but the result it gives back is 00:00:00 for hh24:mi:ss.
    code:
    try
    Class.forName("oracle.jdbc.driver.OracleDriver");
    Connection con = DriverManager.getConnection( connStr, userName, passWord );
         PreparedStatement pstmtQuery = con.prepareStatement(" SELECT to_date(to_char(sysdate,'mm/dd/yyyy hh24:mi:ss'), 'mm/dd/yyyy hh24:mi:ss') SYS_DATE FROM DUAL" );
         ResultSet rsQuery = pstmtQuery.executeQuery();
    DateFormat localFormat1 = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss");
    java.sql.Date date3 = null;
    if(rsQuery.next())
    date3 = rsQuery.getDate("SYS_DATE");
    System.out.println("\ndatabase sysdate: " + localFormat1.format( date3 ));
    catch (SQLException sqle)
    sqle.printStackTrace();
    catch (java.lang.Exception e)
    e.printStackTrace();
    }

    When you use the to_date function, the result you get back will be in the default date format as specified by the nls_date_format property. The data is stored properly (i.e., it includes the time values), but when it's displayed it's displayed in the standard format. So even if the datetime is 10/11/2001 10:12:35, the value that will be displayed when you select sysdate will be 11-OCT-01 if you're using the default date format of DD-MON-YY.
    Are you sure that your statement is returning the desired string when you type it directly into SQL? If so, then I have to guess that your default date format is set up the way you want it when you go into SQL directly, but that a different default date format is used when you're executing the statement via jdbc.
    I've never tried setting the default date format through jdbc, so I don't know if it will work, but the way to set the format is to alter the session:
    alter session set nls_date_format = 'mm/dd/yyyy hh24:mi:ss';
    HTH,
    Rich

  • ORA-20001 When trying to default page element to sysdate

    Hello,
    I have a master detail with last updated in the detail that I want to autopopulate based on sysdate.
    To do that I have Tabular Form Attributes set to sysdate and default type PL/SQL Expression or function.
    The display as is set to "Display as Text(saves state).
    I would like to format the date which I do with Column Attributes and then specify the Number Data Format.
    When I click add row in the detai part of the pagethe date is displayed as desired however then I try and
    apply the changes (save the page) I get ORA-20001: Found invalid date value, please verify date format. (Row 2)
    I have tried formatting the date in the PL/SQL expression with TO_DATE(SYSDATE,'DD-MON-YYYY HH24:MI')
    with the same result.
    If I change the element to Text Field the date is saved correctly however I don't want the user to edit the
    feild.
    Any suggestions? Using APEX 4.1

    I have the same issue.
    1. DEFAULT=SYSDATE when using format mask='DD-MON-YYYY HH24:MI:SS' causes the time portion to appear but ORA-20001 when submitting the row.
    2. Since the base column datatype is DATE, a simple to_char(SYSDATE,'DD-MON-YYYY HH24:MI:SS') obviously causes ORA-01790: expression must have same datatype as corresponding expression.
    3. A to_date(to_char(SYSDATE,'DD-MON-YYYY HH24:MI:SS'),'DD-MON-YYYY HH24:MI:SS') leads to the same error: ORA-20001: Found invalid date value, please verify date format.
    Does anyone know the trick?

  • Defaulting sysdate on save - no time component

    I have a date column (date_modified) in my table and i am displaying on form as date picker DD-MON-YYYY HH:MI. Users can not enter this but they can see it. When I save the record I have am setting the item like<br><br>P1_DATE_MODIFIED := sysdate;<br><br>and then the automatic update process puts it in. trouble is, it is going in without the time component. I have tried <br><br>P1_DATE_MODIFIED := to_date(to_char(sysdate,'dd-mon-yyyy hh24:mi'),'dd-mon-yyyy hh24:mi');<br><br>but no luck there either.<br><br> if i update the column in sqlplus using the sysdate or to_char to_date method then it does get the time component and it displays it in my form. I cant figure out why it loses it when inserting when the last thing i do before insert is convert it to the time format (i shouldn't even need to do that, sysdate should work fine)

    Hi Victorp or any others,
    I am also having a major problem of not able to store time component. I have a field called ":P61_WHEN_CREATED" in my form DISPLAY aS (Date Picker DD-MON-YYYY HH24:MI) and I have a process after submit - Before computations and validations) to set the field value to sysdate as :
    :P61_WHEN_CREATED := to_char(sysdate,'DD-MON-YYYY HH24:MI');
    and after submit after computations and validations I have another process to post the values into table as:
    Insert into c_addendums (MECnum,WHEN_CREATED) values :P61_MECNUM, :P61_WHEN_CREATED;
    But i am getting the error :
    ORA-01830 date format picture ends before converting entire input string.
    Can you please help me.
    rgds,
    Suma.

  • How to convert character value to_date?

    I want to change the time (hours) in sysdate to '10' and then save this new date into a date column for that i've written the following command
    (TO_CHAR(SYSDATE,'DD-MON-RRRR')||' 10:'||TO_CHAR(SYSDATE,'MI:SS AM'))this command will remove the actual hours in sysdate and change it with the value '10'. but the result of this command is a character value. and i want a date value to insert into a date column. for that i've converted this command to_date as follows
    TO_DATE(TO_CHAR(SYSDATE,'DD-MON-RRRR')||' 10:'||TO_CHAR(SYSDATE,'MI:SS AM'))but it gives the following error
    ORA-01830: date format picture ends before converting entire input string
    how to do this?

    Gul wrote:
    I want to change the time (hours) in sysdate to '10' and then save this new date into a date column for that i've written the following command
    (TO_CHAR(SYSDATE,'DD-MON-RRRR')||' 10:'||TO_CHAR(SYSDATE,'MI:SS AM'))this command will remove the actual hours in sysdate and change it with the value '10'. but the result of this command is a character value. and i want a date value to insert into a date column. for that i've converted this command to_date as follows
    TO_DATE(TO_CHAR(SYSDATE,'DD-MON-RRRR')||' 10:'||TO_CHAR(SYSDATE,'MI:SS AM'))but it gives the following error
    ORA-01830: date format picture ends before converting entire input string
    how to do this?TO_DATE(TO_CHAR(SYSDATE,'DD-MON-YYYY')||' 10:'||TO_CHAR(SYSDATE,'MI:SS AM'),'DD-MON-YYYY HH:MI:SS AM')

Maybe you are looking for

  • Flex for a New Project?

    I'm launching a new project and I'm considering using Flex. I'm hoping you can provide me with some feedback on viability and perhaps some guidance. The project would be for building dyanamic, database-driven websites in the recreation industry and a

  • Group by returning more than one column in a single query

    Hello, Sorry to ask such a simple question I guess, but here is my problem. I'm building a query to get say the smallest user_id from employees in the company by department. The query goes like : select emp..department, min(emp.user_id) from employee

  • "did not respond"

    I am a new iMac user. I can connect with someone in the States and with the Apple test connection without any problems. I got the "User did not respond" message when trying to connect with someone in Israel. My firewall is off. We use a Comcast cable

  • TextArea Display Only?

    I would like to have an item type of Textarea(auto-height) which is Display only. When I condition the item to Display only it displays it as Text item. No multi-line. Any suggestions?

  • Converting a html template to php

    How do I convert my html template to a php template? Any help would be appreciated. Thanks