DBAsupport.com Forums - Powered by vBulletin
Results 1 to 4 of 4

Thread: insert a specific time into my date column

  1. #1
    Join Date
    Mar 2001
    Location
    south africa
    Posts
    401

    insert a specific time into my date column

    i have table test with 2 columns
    name,rdate

    what is the select stmt if i want insert a specific time for date into my date column

    insert into test(name,to_char(rdate,'dd-mon-YYYY HH:24:mi:ss AM')
    values(kris,'09-aug-02 10:10:10 AM')

    Is it correct , if do then it's giving error

    Pls advise

    Thank you for the time

  2. #2
    Join Date
    Mar 2001
    Location
    Reading, U.K
    Posts
    598
    try this...

    insert into test values(to_date('09-aug-02 10:10:10 PM', 'dd-mon-yy hh:mi:ss PM'));

    Why don't you use 10:10:10 PM instead of 22:10:10?

    In that case it whld be easy and u can use HH24 while converting the time
    Cheers!
    OraKid.

  3. #3
    Join Date
    Mar 2001
    Location
    south africa
    Posts
    401
    thanks

    I found other way

    insert into test(name,rdate) values
    ('test1',to_timestamp('12-AUG-2003 10:13:11 PM','DD-MON-YYYY HH:MI:SS AM))


    thanks for the help again

  4. #4
    Join Date
    Oct 2002
    Location
    Ljubljana,Slovenia
    Posts
    28
    insert into test(name,to_char(rdate,'dd-mon-YYYY HH:24:mi:ss AM')
    And what is wrong with this ?:

    insert into test(name,rdate )
    values('kris',to_date( '09-aug-2002 10:10:10 AM', 'dd-mon-YYYY HH:mi:ss AM')
    Aleš Orehek

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width