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

Thread: compare date with time

  1. #1
    Join Date
    Jun 2001
    Posts
    45
    i want to find out the records in a table that was inserted starting yesterday 7.00 am and ending today 7.00 am
    Thanks

  2. #2
    Join Date
    Nov 2000
    Location
    greenwich.ct.us
    Posts
    9,092
    Do you have a field that stores when a record was inserted?
    Jeff Hunter

  3. #3
    Join Date
    Jul 2000
    Posts
    521
    If you do not have a date column in your table that records the time when the record is created, its very difficult to find it.

    How serious are you @ it ?
    svk

  4. #4
    Join Date
    Aug 2001
    Posts
    184
    u could probably use logminer. see docs for hwo 2 do it.
    OCP DBA 8i
    ocpwannabe@yahoo.com
    -----------------------------
    When in doubt, pick 'C'.

  5. #5
    Join Date
    Jun 2001
    Posts
    45
    yes i have to process on a data type field

  6. #6
    Join Date
    Jul 2000
    Posts
    521
    Then nothing else can be simpler :

    select * from your_table
    where your_date_column between to_date('12-DEC-2001 070000','DD-MON-YYYY HH24MISS') and to_date('13-DEC-2001 070000','DD-MON-YYYY HH24MISS');
    svk

  7. #7
    Join Date
    Nov 2000
    Location
    greenwich.ct.us
    Posts
    9,092
    SELECT * FROM xyz
    WHERE inserted_date > to_date('20011210 07:00','yyyymmdd hh24:mi')
    AND inserted_date <= to_date('20011211 07:00','yyyymmdd hh24:mi')
    Jeff Hunter

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