DBAsupport.com Forums - Powered by vBulletin
Page 1 of 4 123 ... LastLast
Results 1 to 10 of 32

Thread: created date

  1. #1
    Join Date
    Jun 2000
    Posts
    315

    created date

    I checked there are objects created 14-FEB-2005. So I am trying to get all the objects created yesterday.

    Select object_name from user_objects
    where created = to_date('02/14/2005', 'mm/dd/yyyy');

    But there is no row selectd.

    Why? And how could I get the objects created yesterday?

    THanks!

  2. #2
    Join Date
    Nov 2000
    Location
    greenwich.ct.us
    Posts
    9,092
    Are you serious? Think about it for a minute. Look at your data.
    Jeff Hunter

  3. #3
    Join Date
    Jun 2000
    Posts
    315
    Yes, I am serious! Please help!

  4. #4
    Join Date
    Nov 2000
    Location
    greenwich.ct.us
    Posts
    9,092
    What time is to_date('02/14/2005', 'mm/dd/yyyy')?
    Jeff Hunter

  5. #5
    Join Date
    Aug 2002
    Location
    Colorado Springs
    Posts
    5,253
    Hint: the date column also has a time associated with it, which you cannot see because your default date format does not include it.
    David Aldridge,
    "The Oracle Sponge"

    Senior Manager, Business Intelligence Development
    XM Satellite Radio
    Washington, DC

    Oracle ACE

  6. #6
    Join Date
    Jun 2000
    Posts
    315
    Please let me know! It's urgent for me! I always have problem with date.

    Thanks!

  7. #7
    Join Date
    Jun 2000
    Posts
    315
    I did:

    select object_name from user_objects
    where created = to_date('14-FEB-2005', 'DD-MON-YYYY HH24:MI');

    no row selected.

  8. #8
    Join Date
    Aug 2002
    Location
    Colorado Springs
    Posts
    5,253
    Originally posted by lgaorcl
    I did:

    select object_name from user_objects
    where created = to_date('14-FEB-2005', 'DD-MON-YYYY HH24:MI');

    no row selected.
    i) You need to go read the SQL Reference, and understand what a DATE data type is, as opposed to how it's presented in SQL*Plus.

    ii) select to_char(object_name,'DD-MON-YYYY HH24:MI:SS') from user_objects
    David Aldridge,
    "The Oracle Sponge"

    Senior Manager, Business Intelligence Development
    XM Satellite Radio
    Washington, DC

    Oracle ACE

  9. #9
    Join Date
    Nov 2000
    Location
    greenwich.ct.us
    Posts
    9,092
    Originally posted by lgaorcl
    Please let me know! It's urgent for me! I always have problem with date.
    Since you don't understand what they are, I'm not surprised.
    Jeff Hunter

  10. #10
    Join Date
    Feb 2005
    Location
    India
    Posts
    1
    Try this

    select object_name from user_objects
    where created > to_date('14-FEB-2005', 'DD-MON-YYYY HH24:MI')

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